Red Hat Bugzilla – Bug 504086
GFS2: s_umount locking bug with gfs2meta filesystem type
Last modified: 2009-09-02 04:54:24 EDT
Description of problem:
vfs_kern_mount() expects get_sb() to return the super_block with a write lock on the s_umount semaphore, gfs2_get_sb_meta() doesn't do this.
Version-Release number of selected component (if applicable):
kernel-2.6.18-150.el5 and many others
Steps to Reproduce:
1. mkfs.gfs2 -p lock_nolock -j1 /dev/sdb1
2. mount -t gfs2 /dev/sb1 /mnt/test
3. mount -t gfs2meta /mnt/test /mnt/meta
4. umount /mnt/meta
5. umount /mnt/test
Created attachment 346509 [details]
Ben, does this fix the issue for you? I gave it a quick test and it seems to work ok for simple test cases.
I think we should try and get an exception for this one, as it should be quite quick to verify the fix.
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
You fix works just fine. However I wonder if it isn't overkill. until you do the path_put(), you should be protected from unmounts, right? I don't see why we can't just do a down_write(&sb->s_umount) before the path_put()? It doesn't look like it's necessary to hold a s_umount write lock to modify s_active. Anyways we could always move the s_umount lock earlier if it is.
But I don't have any other problems with your way. So if you prefer it that way, it's fine with me.
Created attachment 346593 [details]
Another possible solution
Here's a one line patch that solves the problem the way I mentioned. Like I said, if you prefer your patch, I'm fine with that.
There is another issue as well... the way we grab the ref to the sb was wrong according to the sb locking scheme. We really wanted to call grab_super() but this is not exported and it also requires taking another lock too.
After some though and consultation with Christoph he thinks that its better to use sget to solve this issue.
I've also posted a further patch relating to the first part of the developements outlined in my recent message to cluster-devel about gfs2-utils developments. That was after a further discussion with Christoph and we might want to incorporate that into any RHEL fix.... I'm not sure at the moment whether thats a good plan or not. What do you think?
Ben, can you post this for 5.4 now? Lets ignore that second patch - I think I'll not push that into upstream. Lets just focus on getting the known bug fixed for now.
You can download this test kernel from http://people.redhat.com/dzickus/el5
Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so. However feel free
to provide a comment indicating that this fix has been verified.
Verified on kernel-2.6.18-154.el5
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.