diff mbox

xfstests: add support for ext4dev FSTYP

Message ID BANLkTimBnAgiXZnvS56eAzEdJ=kw1zVGsg@mail.gmail.com
State Not Applicable, archived
Headers show

Commit Message

Amir Goldstein June 1, 2011, 3:13 a.m. UTC
From: Amir Goldstein <amir73il@users.sf.net>

blkid knows to identify the ext4dev FSTYP of a partition that was
formatted with mkfs.ext4dev.
quota tools and various util-linux utils are also aware of ext4dev,
so ext4dev shares the same capabilities as ext4.

While testing on Fedora 15, we encoutered a buggy fsck utility, which
invokes fsck.ext4, even though it was called with -t ext4dev argument.
In our setup fsck.ext4dev knows about new fs features that fsck.ext4
doesn't know, so the generic_fs_check fails.
Since we have no real use of the extra capabilities provided by fsck util,
we decided to invoke fsck.$FSTYP directly to avoid this issue.

Signed-off-by: Amir Goldstein <amir73il@users.sf.net>
Tested-by: Sergey Ivanov <sergey57@gmail.com>
---
ext4dev is used to test experimental ext4 code in mutual existance
with production ext4 code on the same system.

Specifically, ext4 snapshots code is available for testing as a
stand-alone ext4dev module for Fedora 15 and Ubuntu 11.4
(see http://next3.sf.net).

 common.defrag |    2 +-
 common.quota  |    4 ++--
 common.rc     |   12 ++++++------
 3 files changed, 9 insertions(+), 9 deletions(-)

     *)
@@ -1026,7 +1026,7 @@ _check_generic_filesystem()
         mountpoint=`_umount_or_remount_ro $device`
     fi

-    fsck -t $FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
+    fsck.$FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
     if [ $? -ne 0 ]
     then
         echo "_check_generic_filesystem: filesystem on $device is
inconsistent (see $seq.full)"

Comments

Eric Sandeen June 1, 2011, 4:37 a.m. UTC | #1
On 5/31/11 10:13 PM, Amir Goldstein wrote:
> From: Amir Goldstein <amir73il@users.sf.net>
> 
> blkid knows to identify the ext4dev FSTYP of a partition that was
> formatted with mkfs.ext4dev.
> quota tools and various util-linux utils are also aware of ext4dev,
> so ext4dev shares the same capabilities as ext4.
> 
> While testing on Fedora 15, we encoutered a buggy fsck utility, which
> invokes fsck.ext4, even though it was called with -t ext4dev argument.
> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
> doesn't know, so the generic_fs_check fails.
> Since we have no real use of the extra capabilities provided by fsck util,
> we decided to invoke fsck.$FSTYP directly to avoid this issue.

Adding ext4dev to every case seems harmless enough.  TBH I thought I had
it there already but I guess not.

I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP

What issue are you avoiding?  wouldn't fsck -t ext4dev invoke fsck.ext4dev anyway?

It seems like it should be harmless, but I don't understand how it helps you.

Thanks,
-Eric

> Signed-off-by: Amir Goldstein <amir73il@users.sf.net>
> Tested-by: Sergey Ivanov <sergey57@gmail.com>
> ---
> ext4dev is used to test experimental ext4 code in mutual existance
> with production ext4 code on the same system.
> 
> Specifically, ext4 snapshots code is available for testing as a
> stand-alone ext4dev module for Fedora 15 and Ubuntu 11.4
> (see http://next3.sf.net).
> 
>  common.defrag |    2 +-
>  common.quota  |    4 ++--
>  common.rc     |   12 ++++++------
>  3 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/common.defrag b/common.defrag
> index 1bcf01d..4850803 100644
> --- a/common.defrag
> +++ b/common.defrag
> @@ -26,7 +26,7 @@ _require_defrag()
>      xfs)
>          DEFRAG_PROG=/usr/sbin/xfs_fsr
>  	;;
> -    ext4)
> +    ext4|ext4dev)
>          DEFRAG_PROG=/usr/bin/e4defrag
>  	;;
>      *)
> diff --git a/common.quota b/common.quota
> index 3c87ce1..9eac19d 100644
> --- a/common.quota
> +++ b/common.quota
> @@ -29,7 +29,7 @@ _require_quota()
>      [ -n $QUOTA_PROG ] || _notrun "Quota user tools not installed"
> 
>      case $FSTYP in
> -    ext2|ext3|ext4|reiserfs)
> +    ext2|ext3|ext4|ext4dev|reiserfs)
>  	if [ ! -d /proc/sys/fs/quota ]; then
>  	    _notrun "Installed kernel does not support quotas"
>  	fi
> @@ -237,7 +237,7 @@ _check_quota_usage()
>  	# Sync to get delalloc to disk
>  	sync
>  	VFS_QUOTA=0
> -	if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP
> = "reiserfs" ]; then
> +	if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP
> = "ext4dev" -o $FSTYP = "reiserfs" ]; then
>  		VFS_QUOTA=1
>  		quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
>  	fi
> diff --git a/common.rc b/common.rc
> index e634fbb..e71fe9c 100644
> --- a/common.rc
> +++ b/common.rc
> @@ -65,7 +65,7 @@ _mount_opts()
>      nfs)
>  	export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
>  	;;
> -    ext2|ext3|ext4)
> +    ext2|ext3|ext4|ext4dev)
>  	# acls & xattrs aren't turned on by default on ext$FOO
>  	export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
>  	;;
> @@ -110,7 +110,7 @@ _mkfs_opts()
>  _fsck_opts()
>  {
>      case $FSTYP in
> -    ext2|ext3|ext4)
> +    ext2|ext3|ext4|ext4dev)
>  	export FSCK_OPTIONS="-nf"
>  	;;
>      reiserfs)
> @@ -326,10 +326,10 @@ _scratch_mkfs_sized()
>      xfs)
>  	_scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
>  	;;
> -    ext2|ext3|ext4)
> +    ext2|ext3|ext4|ext4dev)
>  	/sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
>  	;;
> -     btrfs)
> +    btrfs)
>  	/sbin/mkfs.$FSTYP $MKFS_OPTIONS $SCRATCH_DEV -b $fssize
>  	;;
>      *)
> @@ -354,7 +354,7 @@ _scratch_mkfs_geom()
>      xfs)
>  	MKFS_OPTIONS+=" -b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
>  	;;
> -    ext4)
> +    ext4|ext4dev)
>  	MKFS_OPTIONS+=" -b $blocksize -E
> stride=$sunit_blocks,stripe_width=$swidth_blocks"
>  	;;
>      *)
> @@ -1026,7 +1026,7 @@ _check_generic_filesystem()
>          mountpoint=`_umount_or_remount_ro $device`
>      fi
> 
> -    fsck -t $FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
> +    fsck.$FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
>      if [ $? -ne 0 ]
>      then
>          echo "_check_generic_filesystem: filesystem on $device is
> inconsistent (see $seq.full)"

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amir Goldstein June 1, 2011, 4:56 a.m. UTC | #2
On Wed, Jun 1, 2011 at 7:37 AM, Eric Sandeen <sandeen@redhat.com> wrote:
> On 5/31/11 10:13 PM, Amir Goldstein wrote:
>> From: Amir Goldstein <amir73il@users.sf.net>
>>
>> blkid knows to identify the ext4dev FSTYP of a partition that was
>> formatted with mkfs.ext4dev.
>> quota tools and various util-linux utils are also aware of ext4dev,
>> so ext4dev shares the same capabilities as ext4.
>>
>> While testing on Fedora 15, we encoutered a buggy fsck utility, which
>> invokes fsck.ext4, even though it was called with -t ext4dev argument.
>> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
>> doesn't know, so the generic_fs_check fails.
>> Since we have no real use of the extra capabilities provided by fsck util,
>> we decided to invoke fsck.$FSTYP directly to avoid this issue.
>
> Adding ext4dev to every case seems harmless enough.  TBH I thought I had
> it there already but I guess not.
>
> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
>
> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke fsck.ext4dev anyway?
>
> It seems like it should be harmless, but I don't understand how it helps you.
>

As I wrote in the patch description, the fsck utility in Fedora 15 invokes
fsck.ext4 for some reason when calling fsck -t ext4dev.
this fails because fsck.ext4 doesn't know the snapshot feature.
I didn't debug fsck utility for that. it seemed pointless.

> Thanks,
> -Eric
>
>> Signed-off-by: Amir Goldstein <amir73il@users.sf.net>
>> Tested-by: Sergey Ivanov <sergey57@gmail.com>
>> ---
>> ext4dev is used to test experimental ext4 code in mutual existance
>> with production ext4 code on the same system.
>>
>> Specifically, ext4 snapshots code is available for testing as a
>> stand-alone ext4dev module for Fedora 15 and Ubuntu 11.4
>> (see http://next3.sf.net).
>>
>>  common.defrag |    2 +-
>>  common.quota  |    4 ++--
>>  common.rc     |   12 ++++++------
>>  3 files changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/common.defrag b/common.defrag
>> index 1bcf01d..4850803 100644
>> --- a/common.defrag
>> +++ b/common.defrag
>> @@ -26,7 +26,7 @@ _require_defrag()
>>      xfs)
>>          DEFRAG_PROG=/usr/sbin/xfs_fsr
>>       ;;
>> -    ext4)
>> +    ext4|ext4dev)
>>          DEFRAG_PROG=/usr/bin/e4defrag
>>       ;;
>>      *)
>> diff --git a/common.quota b/common.quota
>> index 3c87ce1..9eac19d 100644
>> --- a/common.quota
>> +++ b/common.quota
>> @@ -29,7 +29,7 @@ _require_quota()
>>      [ -n $QUOTA_PROG ] || _notrun "Quota user tools not installed"
>>
>>      case $FSTYP in
>> -    ext2|ext3|ext4|reiserfs)
>> +    ext2|ext3|ext4|ext4dev|reiserfs)
>>       if [ ! -d /proc/sys/fs/quota ]; then
>>           _notrun "Installed kernel does not support quotas"
>>       fi
>> @@ -237,7 +237,7 @@ _check_quota_usage()
>>       # Sync to get delalloc to disk
>>       sync
>>       VFS_QUOTA=0
>> -     if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP
>> = "reiserfs" ]; then
>> +     if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP
>> = "ext4dev" -o $FSTYP = "reiserfs" ]; then
>>               VFS_QUOTA=1
>>               quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
>>       fi
>> diff --git a/common.rc b/common.rc
>> index e634fbb..e71fe9c 100644
>> --- a/common.rc
>> +++ b/common.rc
>> @@ -65,7 +65,7 @@ _mount_opts()
>>      nfs)
>>       export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
>>       ;;
>> -    ext2|ext3|ext4)
>> +    ext2|ext3|ext4|ext4dev)
>>       # acls & xattrs aren't turned on by default on ext$FOO
>>       export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
>>       ;;
>> @@ -110,7 +110,7 @@ _mkfs_opts()
>>  _fsck_opts()
>>  {
>>      case $FSTYP in
>> -    ext2|ext3|ext4)
>> +    ext2|ext3|ext4|ext4dev)
>>       export FSCK_OPTIONS="-nf"
>>       ;;
>>      reiserfs)
>> @@ -326,10 +326,10 @@ _scratch_mkfs_sized()
>>      xfs)
>>       _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
>>       ;;
>> -    ext2|ext3|ext4)
>> +    ext2|ext3|ext4|ext4dev)
>>       /sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
>>       ;;
>> -     btrfs)
>> +    btrfs)
>>       /sbin/mkfs.$FSTYP $MKFS_OPTIONS $SCRATCH_DEV -b $fssize
>>       ;;
>>      *)
>> @@ -354,7 +354,7 @@ _scratch_mkfs_geom()
>>      xfs)
>>       MKFS_OPTIONS+=" -b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
>>       ;;
>> -    ext4)
>> +    ext4|ext4dev)
>>       MKFS_OPTIONS+=" -b $blocksize -E
>> stride=$sunit_blocks,stripe_width=$swidth_blocks"
>>       ;;
>>      *)
>> @@ -1026,7 +1026,7 @@ _check_generic_filesystem()
>>          mountpoint=`_umount_or_remount_ro $device`
>>      fi
>>
>> -    fsck -t $FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
>> +    fsck.$FSTYP $FSCK_OPTIONS $device >$tmp.fsck 2>&1
>>      if [ $? -ne 0 ]
>>      then
>>          echo "_check_generic_filesystem: filesystem on $device is
>> inconsistent (see $seq.full)"
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Sandeen June 1, 2011, 5:22 a.m. UTC | #3
On 5/31/11 11:56 PM, Amir Goldstein wrote:
> On Wed, Jun 1, 2011 at 7:37 AM, Eric Sandeen <sandeen@redhat.com> wrote:
>> On 5/31/11 10:13 PM, Amir Goldstein wrote:
>>> From: Amir Goldstein <amir73il@users.sf.net>
>>>
>>> blkid knows to identify the ext4dev FSTYP of a partition that was
>>> formatted with mkfs.ext4dev.
>>> quota tools and various util-linux utils are also aware of ext4dev,
>>> so ext4dev shares the same capabilities as ext4.
>>>
>>> While testing on Fedora 15, we encoutered a buggy fsck utility, which
>>> invokes fsck.ext4, even though it was called with -t ext4dev argument.
>>> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
>>> doesn't know, so the generic_fs_check fails.
>>> Since we have no real use of the extra capabilities provided by fsck util,
>>> we decided to invoke fsck.$FSTYP directly to avoid this issue.
>>
>> Adding ext4dev to every case seems harmless enough.  TBH I thought I had
>> it there already but I guess not.
>>
>> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
>>
>> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke fsck.ext4dev anyway?
>>
>> It seems like it should be harmless, but I don't understand how it helps you.
>>
> 
> As I wrote in the patch description, the fsck utility in Fedora 15 invokes
> fsck.ext4 for some reason when calling fsck -t ext4dev.

Oh, right.

> this fails because fsck.ext4 doesn't know the snapshot feature.
> I didn't debug fsck utility for that. it seemed pointless.

Did you file a bug with Fedora?  I'd rather fix the root cause than work around it...
Feel free to cc: me on the bug.

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Sandeen June 1, 2011, 5:34 a.m. UTC | #4
On 6/1/11 12:22 AM, Eric Sandeen wrote:
> On 5/31/11 11:56 PM, Amir Goldstein wrote:
>> On Wed, Jun 1, 2011 at 7:37 AM, Eric Sandeen <sandeen@redhat.com> wrote:
>>> On 5/31/11 10:13 PM, Amir Goldstein wrote:
>>>> From: Amir Goldstein <amir73il@users.sf.net>
>>>>
>>>> blkid knows to identify the ext4dev FSTYP of a partition that was
>>>> formatted with mkfs.ext4dev.
>>>> quota tools and various util-linux utils are also aware of ext4dev,
>>>> so ext4dev shares the same capabilities as ext4.
>>>>
>>>> While testing on Fedora 15, we encoutered a buggy fsck utility, which
>>>> invokes fsck.ext4, even though it was called with -t ext4dev argument.
>>>> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
>>>> doesn't know, so the generic_fs_check fails.
>>>> Since we have no real use of the extra capabilities provided by fsck util,
>>>> we decided to invoke fsck.$FSTYP directly to avoid this issue.
>>>
>>> Adding ext4dev to every case seems harmless enough.  TBH I thought I had
>>> it there already but I guess not.
>>>
>>> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
>>>
>>> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke fsck.ext4dev anyway?
>>>
>>> It seems like it should be harmless, but I don't understand how it helps you.
>>>
>>
>> As I wrote in the patch description, the fsck utility in Fedora 15 invokes
>> fsck.ext4 for some reason when calling fsck -t ext4dev.
> 
> Oh, right.
> 
>> this fails because fsck.ext4 doesn't know the snapshot feature.
>> I didn't debug fsck utility for that. it seemed pointless.
> 
> Did you file a bug with Fedora?  I'd rather fix the root cause than work around it...
> Feel free to cc: me on the bug.

RHEL6 does the same; mkfs.ext4dev then fsck -t ext4dev invokes fsck.ext4; but this
is because blkid identifies it as ext4, not ext4dev, despite the test_fs flag being set.

ISTR this is due to some tortured logic about when ext4dev isn't ext4dev, but
I don't remember the details... I don't know if this is the same situation
you're seeing; just to double check - does blkid correctly identify it as ext4dev
on F15?

-Eric

> -Eric
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amir Goldstein June 1, 2011, 6:37 a.m. UTC | #5
On Wed, Jun 1, 2011 at 8:34 AM, Eric Sandeen <sandeen@redhat.com> wrote:
> On 6/1/11 12:22 AM, Eric Sandeen wrote:
>> On 5/31/11 11:56 PM, Amir Goldstein wrote:
>>> On Wed, Jun 1, 2011 at 7:37 AM, Eric Sandeen <sandeen@redhat.com> wrote:
>>>> On 5/31/11 10:13 PM, Amir Goldstein wrote:
>>>>> From: Amir Goldstein <amir73il@users.sf.net>
>>>>>
>>>>> blkid knows to identify the ext4dev FSTYP of a partition that was
>>>>> formatted with mkfs.ext4dev.
>>>>> quota tools and various util-linux utils are also aware of ext4dev,
>>>>> so ext4dev shares the same capabilities as ext4.
>>>>>
>>>>> While testing on Fedora 15, we encoutered a buggy fsck utility, which
>>>>> invokes fsck.ext4, even though it was called with -t ext4dev argument.
>>>>> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
>>>>> doesn't know, so the generic_fs_check fails.
>>>>> Since we have no real use of the extra capabilities provided by fsck util,
>>>>> we decided to invoke fsck.$FSTYP directly to avoid this issue.
>>>>
>>>> Adding ext4dev to every case seems harmless enough.  TBH I thought I had
>>>> it there already but I guess not.
>>>>
>>>> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
>>>>
>>>> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke fsck.ext4dev anyway?
>>>>
>>>> It seems like it should be harmless, but I don't understand how it helps you.
>>>>
>>>
>>> As I wrote in the patch description, the fsck utility in Fedora 15 invokes
>>> fsck.ext4 for some reason when calling fsck -t ext4dev.
>>
>> Oh, right.
>>
>>> this fails because fsck.ext4 doesn't know the snapshot feature.
>>> I didn't debug fsck utility for that. it seemed pointless.
>>
>> Did you file a bug with Fedora?  I'd rather fix the root cause than work around it...
>> Feel free to cc: me on the bug.

No, I didn't file a bug.
In any case, it was Sergey, who tested and reported the problem on F15.

Would you agree to fix the problem in xfstests now, so that F15 users can
test ext4dev and fix the bug in fsck regardless?

>
> RHEL6 does the same; mkfs.ext4dev then fsck -t ext4dev invokes fsck.ext4; but this
> is because blkid identifies it as ext4, not ext4dev, despite the test_fs flag being set.
>
> ISTR this is due to some tortured logic about when ext4dev isn't ext4dev, but
> I don't remember the details... I don't know if this is the same situation
> you're seeing; just to double check - does blkid correctly identify it as ext4dev
> on F15?


For me (on Ubuntu) blkid identifies ext4dev, but maybe the tortured logic
finds unknown features a justification for declaring ext4dev?
Segrey, can you answer the question for F15?
Did you set FSTYP to ext4dev manually or did blkid identified it for you?

>
> -Eric
>
>> -Eric
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Amir Goldstein June 1, 2011, 12:37 p.m. UTC | #6
On Wed, Jun 1, 2011 at 2:48 PM, sergey ivanov <sergey57@gmail.com> wrote:
> On Wed, Jun 1, 2011 at 2:37 AM, Amir Goldstein <amir73il@gmail.com> wrote:
>>
>> On Wed, Jun 1, 2011 at 8:34 AM, Eric Sandeen <sandeen@redhat.com> wrote:
>> > On 6/1/11 12:22 AM, Eric Sandeen wrote:
>> >> On 5/31/11 11:56 PM, Amir Goldstein wrote:
>> >>> On Wed, Jun 1, 2011 at 7:37 AM, Eric Sandeen <sandeen@redhat.com>
>> >>> wrote:
>> >>>> On 5/31/11 10:13 PM, Amir Goldstein wrote:
>> >>>>> From: Amir Goldstein <amir73il@users.sf.net>
>> >>>>>
>> >>>>> blkid knows to identify the ext4dev FSTYP of a partition that was
>> >>>>> formatted with mkfs.ext4dev.
>> >>>>> quota tools and various util-linux utils are also aware of ext4dev,
>> >>>>> so ext4dev shares the same capabilities as ext4.
>> >>>>>
>> >>>>> While testing on Fedora 15, we encoutered a buggy fsck utility,
>> >>>>> which
>> >>>>> invokes fsck.ext4, even though it was called with -t ext4dev
>> >>>>> argument.
>> >>>>> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
>> >>>>> doesn't know, so the generic_fs_check fails.
>> >>>>> Since we have no real use of the extra capabilities provided by fsck
>> >>>>> util,
>> >>>>> we decided to invoke fsck.$FSTYP directly to avoid this issue.
>> >>>>
>> >>>> Adding ext4dev to every case seems harmless enough.  TBH I thought I
>> >>>> had
>> >>>> it there already but I guess not.
>> >>>>
>> >>>> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
>> >>>>
>> >>>> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke
>> >>>> fsck.ext4dev anyway?
>> >>>>
>> >>>> It seems like it should be harmless, but I don't understand how it
>> >>>> helps you.
>> >>>>
>> >>>
>> >>> As I wrote in the patch description, the fsck utility in Fedora 15
>> >>> invokes
>> >>> fsck.ext4 for some reason when calling fsck -t ext4dev.
>> >>
>> >> Oh, right.
>> >>
>> >>> this fails because fsck.ext4 doesn't know the snapshot feature.
>> >>> I didn't debug fsck utility for that. it seemed pointless.
>> >>
>> >> Did you file a bug with Fedora?  I'd rather fix the root cause than
>> >> work around it...
>> >> Feel free to cc: me on the bug.
>>
>> No, I didn't file a bug.
>> In any case, it was Sergey, who tested and reported the problem on F15.
>>
>> Would you agree to fix the problem in xfstests now, so that F15 users can
>> test ext4dev and fix the bug in fsck regardless?
>>
>> >
>> > RHEL6 does the same; mkfs.ext4dev then fsck -t ext4dev invokes
>> > fsck.ext4; but this
>> > is because blkid identifies it as ext4, not ext4dev, despite the test_fs
>> > flag being set.
>> >
>> > ISTR this is due to some tortured logic about when ext4dev isn't
>> > ext4dev, but
>> > I don't remember the details... I don't know if this is the same
>> > situation
>> > you're seeing; just to double check - does blkid correctly identify it
>> > as ext4dev
>> > on F15?
>>
>>
>> For me (on Ubuntu) blkid identifies ext4dev, but maybe the tortured logic
>> finds unknown features a justification for declaring ext4dev?
>> Segrey, can you answer the question for F15?
>> Did you set FSTYP to ext4dev manually or did blkid identified it for you?
>
> Amir, Fedora's fsck behaves differently on ext4dev and next4. When I made
> next4 partition on Fedora-15 by
> {{{
> mkfs  -t next4 /dev/sdd9
> }}}
> it requires "export FSTYP=next4" to be defined and exported in local.conf.
> It mounts partition with
> {{{
> mount -t next4 /dev/sdd9 /mnt/sdd9
> }}}
> But on attempt to fsck it calls wrong fsck, as you reported:
> {{{
> [seriv@pimbra xfstests]$ sudo fsck -t next4 /dev/sdd9
> fsck from util-linux 2.19.1
> e2fsck 1.41.14 (22-Dec-2010)
> /dev/sdd9 has unsupported feature(s): FEATURE_C7 FEATURE_C8 FEATURE_R7
> e2fsck: Get a newer version of e2fsck!
> }}}
> And the problem can be easily traced to this wrong call:
> {{{
> [seriv@pimbra xfstests]$ sudo strace -o /var/log/fsck.strace fsck -t next4
> /dev/sdd9
> fsck from util-linux 2.19.1
> e2fsck 1.41.14 (22-Dec-2010)
> /dev/sdd9 has unsupported feature(s): FEATURE_C7 FEATURE_C8 FEATURE_R7
> e2fsck: Get a newer version of e2fsck!
> [seriv@pimbra xfstests]$ grep sbin /var/log/fsck.strace
> execve("/sbin/fsck", ["fsck", "-t", "next4", "/dev/sdd9"], [/* 17 vars */])
> = 0
> stat("/sbin/fsck.ext4", {st_mode=S_IFREG|0755, st_size=194280, ...}) = 0
> }}}
> But it's not the case for ext4dev, with it I even don't need "-t ext4dev",
> it is recognized by blkid:
> {{{
> [seriv@pimbra xfstests]$ sudo mkfs -t ext4dev /dev/sdd9
> mke2fs 1.41.14-next3-1.0.13-7 (24-May-2011)
> [skip]
> This filesystem will be automatically checked every 27 mounts or
> 180 days, whichever comes first.  Use tune2fs -c or -i to override.
> [seriv@pimbra xfstests]$ sudo mount /dev/sdd9 /mnt/sdd9
> [seriv@pimbra xfstests]$ mount | grep sdd9
> /dev/sdd9 on /mnt/sdd9 type ext4dev (rw)
> [seriv@pimbra xfstests]$ sudo umount /dev/sdd9
> [seriv@pimbra xfstests]$ sudo fsck /dev/sdd9
> fsck from util-linux 2.19.1
> e2fsck 1.41.14-next3-1.0.13-7 (24-May-2011)
> The test_fs flag is set (and ext4 is available).  Clear<y>?
> }}}
> and at this point in another session
> {{{
> [seriv@pimbra xfstests]$ pgrep -f -l fsck
> 4365 sudo fsck /dev/sdd9
> 4366 fsck /dev/sdd9
> 4367 fsck.ext4dev /dev/sdd9
> }}}
> So I'd like this patch to be applied to xfstests to be able to use it on the
> different filesystems, - if not, then why have this FSTYP and not rely upon
> blkid
> --

To make a long story a bit shorter, there was no intention to set
FSTYP manually,
that was only a temporary hack to make next4 clone work, but since ext4dev is
identified by blkid and respected by fsck/mkfs/mount, we are going to
work with it
and not with next4.

So I understood the problem incorrectly and the patch to xfstests doesn't need
to change fsck -t $FSTYP to fsck.$FSTYP.
I will resend the patch without this change.

Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric Sandeen June 1, 2011, 3:27 p.m. UTC | #7
On 6/1/11 7:37 AM, Amir Goldstein wrote:
> On Wed, Jun 1, 2011 at 2:48 PM, sergey ivanov <sergey57@gmail.com> wrote:
>> On Wed, Jun 1, 2011 at 2:37 AM, Amir Goldstein <amir73il@gmail.com> wrote:
>>>
>>> On Wed, Jun 1, 2011 at 8:34 AM, Eric Sandeen <sandeen@redhat.com> wrote:
>>>> On 6/1/11 12:22 AM, Eric Sandeen wrote:
>>>>> On 5/31/11 11:56 PM, Amir Goldstein wrote:
>>>>>> On Wed, Jun 1, 2011 at 7:37 AM, Eric Sandeen <sandeen@redhat.com>
>>>>>> wrote:
>>>>>>> On 5/31/11 10:13 PM, Amir Goldstein wrote:
>>>>>>>> From: Amir Goldstein <amir73il@users.sf.net>
>>>>>>>>
>>>>>>>> blkid knows to identify the ext4dev FSTYP of a partition that was
>>>>>>>> formatted with mkfs.ext4dev.
>>>>>>>> quota tools and various util-linux utils are also aware of ext4dev,
>>>>>>>> so ext4dev shares the same capabilities as ext4.
>>>>>>>>
>>>>>>>> While testing on Fedora 15, we encoutered a buggy fsck utility,
>>>>>>>> which
>>>>>>>> invokes fsck.ext4, even though it was called with -t ext4dev
>>>>>>>> argument.
>>>>>>>> In our setup fsck.ext4dev knows about new fs features that fsck.ext4
>>>>>>>> doesn't know, so the generic_fs_check fails.
>>>>>>>> Since we have no real use of the extra capabilities provided by fsck
>>>>>>>> util,
>>>>>>>> we decided to invoke fsck.$FSTYP directly to avoid this issue.
>>>>>>>
>>>>>>> Adding ext4dev to every case seems harmless enough.  TBH I thought I
>>>>>>> had
>>>>>>> it there already but I guess not.
>>>>>>>
>>>>>>> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
>>>>>>>
>>>>>>> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke
>>>>>>> fsck.ext4dev anyway?
>>>>>>>
>>>>>>> It seems like it should be harmless, but I don't understand how it
>>>>>>> helps you.
>>>>>>>
>>>>>>
>>>>>> As I wrote in the patch description, the fsck utility in Fedora 15
>>>>>> invokes
>>>>>> fsck.ext4 for some reason when calling fsck -t ext4dev.
>>>>>
>>>>> Oh, right.
>>>>>
>>>>>> this fails because fsck.ext4 doesn't know the snapshot feature.
>>>>>> I didn't debug fsck utility for that. it seemed pointless.
>>>>>
>>>>> Did you file a bug with Fedora?  I'd rather fix the root cause than
>>>>> work around it...
>>>>> Feel free to cc: me on the bug.
>>>
>>> No, I didn't file a bug.
>>> In any case, it was Sergey, who tested and reported the problem on F15.
>>>
>>> Would you agree to fix the problem in xfstests now, so that F15 users can
>>> test ext4dev and fix the bug in fsck regardless?
>>>
>>>>
>>>> RHEL6 does the same; mkfs.ext4dev then fsck -t ext4dev invokes
>>>> fsck.ext4; but this
>>>> is because blkid identifies it as ext4, not ext4dev, despite the test_fs
>>>> flag being set.
>>>>
>>>> ISTR this is due to some tortured logic about when ext4dev isn't
>>>> ext4dev, but
>>>> I don't remember the details... I don't know if this is the same
>>>> situation
>>>> you're seeing; just to double check - does blkid correctly identify it
>>>> as ext4dev
>>>> on F15?
>>>
>>>
>>> For me (on Ubuntu) blkid identifies ext4dev, but maybe the tortured logic
>>> finds unknown features a justification for declaring ext4dev?
>>> Segrey, can you answer the question for F15?
>>> Did you set FSTYP to ext4dev manually or did blkid identified it for you?
>>
>> Amir, Fedora's fsck behaves differently on ext4dev and next4. When I made
>> next4 partition on Fedora-15 by
>> {{{
>> mkfs  -t next4 /dev/sdd9
>> }}}
>> it requires "export FSTYP=next4" to be defined and exported in local.conf.
>> It mounts partition with
>> {{{
>> mount -t next4 /dev/sdd9 /mnt/sdd9
>> }}}
>> But on attempt to fsck it calls wrong fsck, as you reported:
>> {{{
>> [seriv@pimbra xfstests]$ sudo fsck -t next4 /dev/sdd9
>> fsck from util-linux 2.19.1
>> e2fsck 1.41.14 (22-Dec-2010)
>> /dev/sdd9 has unsupported feature(s): FEATURE_C7 FEATURE_C8 FEATURE_R7
>> e2fsck: Get a newer version of e2fsck!
>> }}}
>> And the problem can be easily traced to this wrong call:
>> {{{
>> [seriv@pimbra xfstests]$ sudo strace -o /var/log/fsck.strace fsck -t next4
>> /dev/sdd9
>> fsck from util-linux 2.19.1
>> e2fsck 1.41.14 (22-Dec-2010)
>> /dev/sdd9 has unsupported feature(s): FEATURE_C7 FEATURE_C8 FEATURE_R7
>> e2fsck: Get a newer version of e2fsck!
>> [seriv@pimbra xfstests]$ grep sbin /var/log/fsck.strace
>> execve("/sbin/fsck", ["fsck", "-t", "next4", "/dev/sdd9"], [/* 17 vars */])
>> = 0
>> stat("/sbin/fsck.ext4", {st_mode=S_IFREG|0755, st_size=194280, ...}) = 0
>> }}}
>> But it's not the case for ext4dev, with it I even don't need "-t ext4dev",
>> it is recognized by blkid:
>> {{{
>> [seriv@pimbra xfstests]$ sudo mkfs -t ext4dev /dev/sdd9
>> mke2fs 1.41.14-next3-1.0.13-7 (24-May-2011)
>> [skip]
>> This filesystem will be automatically checked every 27 mounts or
>> 180 days, whichever comes first.  Use tune2fs -c or -i to override.
>> [seriv@pimbra xfstests]$ sudo mount /dev/sdd9 /mnt/sdd9
>> [seriv@pimbra xfstests]$ mount | grep sdd9
>> /dev/sdd9 on /mnt/sdd9 type ext4dev (rw)
>> [seriv@pimbra xfstests]$ sudo umount /dev/sdd9
>> [seriv@pimbra xfstests]$ sudo fsck /dev/sdd9
>> fsck from util-linux 2.19.1
>> e2fsck 1.41.14-next3-1.0.13-7 (24-May-2011)
>> The test_fs flag is set (and ext4 is available).  Clear<y>?
>> }}}
>> and at this point in another session
>> {{{
>> [seriv@pimbra xfstests]$ pgrep -f -l fsck
>> 4365 sudo fsck /dev/sdd9
>> 4366 fsck /dev/sdd9
>> 4367 fsck.ext4dev /dev/sdd9
>> }}}
>> So I'd like this patch to be applied to xfstests to be able to use it on the
>> different filesystems, - if not, then why have this FSTYP and not rely upon
>> blkid
>> --
> 
> To make a long story a bit shorter, there was no intention to set
> FSTYP manually,
> that was only a temporary hack to make next4 clone work, but since ext4dev is
> identified by blkid and respected by fsck/mkfs/mount, we are going to
> work with it
> and not with next4.
> 
> So I understood the problem incorrectly and the patch to xfstests doesn't need
> to change fsck -t $FSTYP to fsck.$FSTYP.
> I will resend the patch without this change.

Thanks, that makes sense to me.

Just wanted to make sure we weren't masking some other problem by working around it in xfstests ...

-Eric

> Amir.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o June 2, 2011, 1:47 a.m. UTC | #8
On Tue, May 31, 2011 at 11:37:18PM -0500, Eric Sandeen wrote:
> 
> I'm less certain of the change from fsck -t $FSTYP to fsck.$FSTYP
> 
> What issue are you avoiding?  wouldn't fsck -t ext4dev invoke
> fsck.ext4dev anyway?

This is a change I make locally when I've been debugging my bigalloc
code as well.  There reason for that is because I want to override the
fsck.ext4 that would get used by using path hacking.  The problem was
that fsck -t ext4 will look for /sbin/fsck.ext4, where as I wanted it
to use the fsck.ext4 that was first in the PATH.

So I changed "/sbin/fsck -t $FSTYP" to "fsck.$FSTYP" and made sure
/sbin was tacked onto the path. 

It might be that the right answer is that fsck should have an
environment variable or some other way of controlling the search path
it uses to find the fsck.XXX binary.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common.defrag b/common.defrag
index 1bcf01d..4850803 100644
--- a/common.defrag
+++ b/common.defrag
@@ -26,7 +26,7 @@  _require_defrag()
     xfs)
         DEFRAG_PROG=/usr/sbin/xfs_fsr
 	;;
-    ext4)
+    ext4|ext4dev)
         DEFRAG_PROG=/usr/bin/e4defrag
 	;;
     *)
diff --git a/common.quota b/common.quota
index 3c87ce1..9eac19d 100644
--- a/common.quota
+++ b/common.quota
@@ -29,7 +29,7 @@  _require_quota()
     [ -n $QUOTA_PROG ] || _notrun "Quota user tools not installed"

     case $FSTYP in
-    ext2|ext3|ext4|reiserfs)
+    ext2|ext3|ext4|ext4dev|reiserfs)
 	if [ ! -d /proc/sys/fs/quota ]; then
 	    _notrun "Installed kernel does not support quotas"
 	fi
@@ -237,7 +237,7 @@  _check_quota_usage()
 	# Sync to get delalloc to disk
 	sync
 	VFS_QUOTA=0
-	if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP
= "reiserfs" ]; then
+	if [ $FSTYP = "ext2" -o $FSTYP = "ext3" -o $FSTYP = "ext4" -o $FSTYP
= "ext4dev" -o $FSTYP = "reiserfs" ]; then
 		VFS_QUOTA=1
 		quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
 	fi
diff --git a/common.rc b/common.rc
index e634fbb..e71fe9c 100644
--- a/common.rc
+++ b/common.rc
@@ -65,7 +65,7 @@  _mount_opts()
     nfs)
 	export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
 	;;
-    ext2|ext3|ext4)
+    ext2|ext3|ext4|ext4dev)
 	# acls & xattrs aren't turned on by default on ext$FOO
 	export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 	;;
@@ -110,7 +110,7 @@  _mkfs_opts()
 _fsck_opts()
 {
     case $FSTYP in
-    ext2|ext3|ext4)
+    ext2|ext3|ext4|ext4dev)
 	export FSCK_OPTIONS="-nf"
 	;;
     reiserfs)
@@ -326,10 +326,10 @@  _scratch_mkfs_sized()
     xfs)
 	_scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
 	;;
-    ext2|ext3|ext4)
+    ext2|ext3|ext4|ext4dev)
 	/sbin/mkfs.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
 	;;
-     btrfs)
+    btrfs)
 	/sbin/mkfs.$FSTYP $MKFS_OPTIONS $SCRATCH_DEV -b $fssize
 	;;
     *)
@@ -354,7 +354,7 @@  _scratch_mkfs_geom()
     xfs)
 	MKFS_OPTIONS+=" -b size=$blocksize, -d su=$sunit_bytes,sw=$swidth_mult"
 	;;
-    ext4)
+    ext4|ext4dev)
 	MKFS_OPTIONS+=" -b $blocksize -E
stride=$sunit_blocks,stripe_width=$swidth_blocks"
 	;;