Skip to contentSkip to conversation

XFS / Quota Bug in 2.6.17.x and 2.6.18x

DISCUSSION ProfiHost - Stefan Priebe 4 participants 12 messages Jul 27, 2006 – Jul 29, 2006 VFS

lore
Share & tools
lore
#0 lore raw

Hello!

The crash only occurs if you use quota and IDE without barrier support.

The Problem is, that on a new mount of a root filesystem - the flag VFS_RDONLY is set - and so no barrier check is done before checking quota. With this patch barrier check is done always. The partition should not be mounted at that moment. For mount -o remount, rw or something like this it uses another function where VFS_RDONLY is checked.

Error Message:
ns2 Wed Jul 26 14:22:58 2006 "I/O error in filesystem ("hda6") meta-data dev
hda6 block 0x23db5ab ("xlog_iodone") error 5 buf count 1024"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x2) called from line 959 of file fs/xfs/xfs_log.c. Return address = 0xc0211535"
ns2 Wed Jul 26 14:22:58 2006 "Filesystem "hda6": Log I/O Error Detected. Shutting down filesystem: hda6"
ns2 Wed Jul 26 14:22:58 2006 "Please umount the filesystem, and rectify the problem(s)"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc0211535"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc0211535"

Patch:
*** fs/xfs/xfs_vfsops.c.orig Thu Jul 27 13:10:23 2006
--- fs/xfs/xfs_vfsops.c Thu Jul 27 13:11:17 2006
*************** xfs_mount(
*** 524,528 ****
goto error2;

! if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag &
VFS_RDONLY))
xfs_mountfs_check_barriers(mp);

--- 524,528 ----
goto error2;

! if (mp->m_flags & XFS_MOUNT_BARRIER)
xfs_mountfs_check_barriers(mp);

Best regards,
Ihr ProfiHost Team
------------------------------------------
ProfiHost e.K.
Lindener Str 15
38300 Wolfenbüttel

Tel.: 05331 996890
Fax: 05331 996899
URL: http://www.profihost.com
E-Mail: [email protected]

#1 lore raw

On Thu, Jul 27, 2006 at 01:39:29PM +0200, ProfiHost - Stefan Priebe wrote:

Please regenerate patch with "diff -up" and sent it to Nathan Scott <[email protected]>, CC'ing [email protected], [email protected]

Also, read section 11 of Documentation/SubmittingPatches and if one of clauses is applicable to you add appropriate "Signed-off-by" line.

Quoted 41 lines

The crash only occurs if you use quota and IDE without barrier support.

The Problem is, that on a new mount of a root filesystem - the flag VFS_RDONLY is set - and so no barrier check is done before checking quota. With this patch barrier check is done always. The partition should not be mounted at that moment. For mount -o remount, rw or something like this it uses another function where VFS_RDONLY is checked.

Error Message:
ns2 Wed Jul 26 14:22:58 2006 "I/O error in filesystem ("hda6") meta-data dev
hda6 block 0x23db5ab ("xlog_iodone") error 5 buf count 1024"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x2) called from line 959 of file fs/xfs/xfs_log.c. Return address = 0xc0211535"
ns2 Wed Jul 26 14:22:58 2006 "Filesystem "hda6": Log I/O Error Detected. Shutting down filesystem: hda6"
ns2 Wed Jul 26 14:22:58 2006 "Please umount the filesystem, and rectify the problem(s)"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc0211535"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc0211535"

Patch:
*** fs/xfs/xfs_vfsops.c.orig Thu Jul 27 13:10:23 2006
--- fs/xfs/xfs_vfsops.c Thu Jul 27 13:11:17 2006
*************** xfs_mount(
*** 524,528 ****
goto error2;

! if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag &
VFS_RDONLY))
xfs_mountfs_check_barriers(mp);

--- 524,528 ----
goto error2;

! if (mp->m_flags & XFS_MOUNT_BARRIER)
xfs_mountfs_check_barriers(mp);

#2 lore raw

Hello!

The crash only occurs if you use quota and an IDE Drive without barrier support.

The Problem is, that on a new mount of a root filesystem - the flag VFS_RDONLY is set - and so no barrier check is done before checking quota. With this patch barrier check is done always. The partition should not be mounted at that moment, so it could not be READ ONLY. For mount -o remount, rw or something like this - XFS uses another function where VFS_RDONLY is checked.

Error Message:
ns2 Wed Jul 26 14:22:58 2006 "I/O error in filesystem ("hda6") meta-data dev
hda6 block 0x23db5ab ("xlog_iodone") error 5 buf count 1024"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x2) called from line 959 of file fs/xfs/xfs_log.c. Return address = 0xc0211535"
ns2 Wed Jul 26 14:22:58 2006 "Filesystem "hda6": Log I/O Error Detected. Shutting down filesystem: hda6"
ns2 Wed Jul 26 14:22:58 2006 "Please umount the filesystem, and rectify the problem(s)"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc0211535"
ns2 Wed Jul 26 14:22:58 2006 "xfs_force_shutdown(hda6,0x1) called from line 338 of file fs/xfs/xfs_rw.c. Return address = 0xc0211535"

Patch:

xfs/xfs_vfsops.c 2006-07-27 14:22:28.246141000 +0200 renamed from xfs/xfs_vfsops.c.orig 2006-07-27 14:22:25.185949750 +0200 +1 -1
@@ -523,7 +523,7 @@ xfs_mount(
        if (error)
                goto error2;
 
-       if ((mp->m_flags & XFS_MOUNT_BARRIER) && !(vfsp->vfs_flag & VFS_RDONLY))
+       if (mp->m_flags & XFS_MOUNT_BARRIER)
                xfs_mountfs_check_barriers(mp);
 
        error = XFS_IOINIT(vfsp, args, flags);

Best regards,
Stefan
Ihr ProfiHost Team
------------------------------------------
ProfiHost e.K.
Lindener Str 15
38300 Wolfenbüttel

Tel.: 05331 996890
Fax: 05331 996899
URL: http://www.profihost.com
E-Mail: [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to ProfiHost - Stefan Priebe

Hi Stefan,

Quoted 9 lines · ProfiHost - Stefan Priebe

Hello!

The crash only occurs if you use quota and IDE without barrier support.

The Problem is, that on a new mount of a root filesystem - the flag VFS_RDONLY is set - and so no barrier check is done before checking quota. With this patch barrier check is done always. The partition should not be mounted at that moment. For mount -o remount, rw or something like this it uses another function where VFS_RDONLY is checked.

Ah, I see. The patch isn't quite right, I think we will now need to also add a test to xfs_mountfs_check_barriers() to ensure the device beneath us is not bdev_read_only().

I'll add that and get the fix merged, thanks.

cheers.

Signature · 1 line
Nathan
#4 lore raw
In reply to ProfiHost - Stefan Priebe
Quoted 2 lines

The crash only occurs if you use quota and IDE without barrier support.

I don't quite get this. I do use quota, and have barriers turned off (either explicitly or because the drive does not support it), but yet no error message like you posted. Do I just have luck?

Quoted 5 lines

The Problem is, that on a new mount of a root filesystem - the flag VFS_RDONLY is set - and so no barrier check is done before checking quota. With this patch barrier check is done always. The partition should not be mounted at that moment. For mount -o remount, rw or something like this it uses another function where VFS_RDONLY is checked.

Jan Engelhardt

#5 lore raw
Quoted 6 lines · Jan Engelhardt
Quoted 2 lines

The crash only occurs if you use quota and IDE without barrier support.

I don't quite get this. I do use quota, and have barriers turned off (either explicitly or because the drive does not support it), but yet no error message like you posted. Do I just have luck?

Heh, no - its more likely you just haven't needed to do a quotacheck on a filesystem thats initially mounted readonly (like root often is). I'm guessing you had quota enabled from earlier barrier-unaware kernels and quotacheck only needs to be run during that initial mount.

cheers.

Signature · 1 line
Nathan
#6 lore raw
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

The crash only occurs if you use quota and IDE without barrier support.

I don't quite get this. I do use quota, and have barriers turned off (either explicitly or because the drive does not support it), but yet no error message like you posted. Do I just have luck?

Heh, no - its more likely you just haven't needed to do a quotacheck on a filesystem thats initially mounted readonly (like root often is).

Well I "sometimes" do that, i.e. intentionally turning off quota on the running system, to force a recheck on boot. The mount options essentially are /bin/mount /dev/hda2 / -o ro,usrquota,grpquota and then /bin/mount / -o remount,rw
No breakage so far, which is why I wondered. Is it limited to a specific kernel version?

Quoted 2 lines

I'm guessing you had quota enabled from earlier barrier-unaware kernels and quotacheck only needs to be run during that initial mount.

Jan Engelhardt

#7 lore raw

Hi!

This only happens, if your partition is the root partition of the whole system and it is mounted read only on system start up. The pre barrier check for normal mount works without any problems.

Stefan

Quoted 20 lines · Jan Engelhardt
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

The crash only occurs if you use quota and IDE without barrier support.

I don't quite get this. I do use quota, and have barriers turned off (either explicitly or because the drive does not support it), but yet no error message like you posted. Do I just have luck?

Heh, no - its more likely you just haven't needed to do a quotacheck on a filesystem thats initially mounted readonly (like root often is).

Well I "sometimes" do that, i.e. intentionally turning off quota on the running system, to force a recheck on boot. The mount options essentially are /bin/mount /dev/hda2 / -o ro,usrquota,grpquota and then /bin/mount / -o remount,rw
No breakage so far, which is why I wondered. Is it limited to a specific kernel version?

Quoted 2 lines

I'm guessing you had quota enabled from earlier barrier-unaware kernels and quotacheck only needs to be run during that initial mount.

Jan Engelhardt

#8 lore raw
Quoted 3 lines

This only happens, if your partition is the root partition of the whole system

It is..

Quoted 2 lines

and it is mounted read only on system start up.

It is...

Quoted 2 lines

The pre barrier check for normal mount works without any problems.

Dang, I forgot that hda is a little older and does not support barriers. /me slaps himself.

Jan Engelhardt

#9 lore raw

Hi!

Quoted 3 lines
Quoted 1 line

The pre barrier check for normal mount works without any problems.

Dang, I forgot that hda is a little older and does not support barriers. /me slaps himself.

That matches for me too. My drives are also too old to support barriers. It occours on about 35 servers - so not all filesystems could be damaged.

So please recheck the following:

1.) You need a Kernel, where barriers are on by default:
so something like: 2.6.16.2x or 2.6.17.x
I'm not shure of the minimal version for the 2.6.16.x Kernel tree.

2.) that hda2 is / on your system

3.) you boot your system with kernel option rootflags=quota

4.) do not use mount, to deactivate quota - use quotaoff / command

5.) then reboot your system...

Stefan

Quoted 18 lines · Jan Engelhardt
Quoted 2 lines

This only happens, if your partition is the root partition of the whole system

It is..

Quoted 2 lines

and it is mounted read only on system start up.

It is...

Quoted 1 line

The pre barrier check for normal mount works without any problems.

Dang, I forgot that hda is a little older and does not support barriers. /me slaps himself.

Jan Engelhardt

#10 lore raw
Quoted 3 lines

1.) You need a Kernel, where barriers are on by default:
so something like: 2.6.16.2x or 2.6.17.x
I'm not shure of the minimal version for the 2.6.16.x Kernel tree.

2.6.17.6

Quoted 1 line

3.) you boot your system with kernel option rootflags=quota

Ah I think there it is. I do boot with rootflags=, but since the initrd does the interpreting of rootflags= and mounting of /dev/hda2(/), that should pose a different situation?

Jan Engelhardt

#11 lore raw

Hi!

Correct - it only happens, if you use rootflags=quota without initrd.

Stefan

Quoted 15 lines · Jan Engelhardt
Quoted 3 lines

1.) You need a Kernel, where barriers are on by default:
so something like: 2.6.16.2x or 2.6.17.x
I'm not shure of the minimal version for the 2.6.16.x Kernel tree.

2.6.17.6

Quoted 1 line

3.) you boot your system with kernel option rootflags=quota

Ah I think there it is. I do boot with rootflags=, but since the initrd does the interpreting of rootflags= and mounting of /dev/hda2(/), that should pose a different situation?

Jan Engelhardt