[dm-devel] [PATCH] deadlock with suspend and quotas

Mikulas Patocka mpatocka at redhat.com
Tue Jan 3 18:35:32 UTC 2012



On Tue, 3 Jan 2012, Mikulas Patocka wrote:

> 
> 
> On Tue, 3 Jan 2012, Al Viro wrote:
> 
> > On Fri, Nov 25, 2011 at 03:25:16PM -0500, Mikulas Patocka wrote:
> > 
> > > The following patch fixes the deadlock. When the quota subsystem takes s_umount,
> > > it checks if the filesystem is frozen. If it is, we drop s_umount, wait for
> > > the filesystem to resume and retry.
> > > 
> > > Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
> > > CC: stable at kernel.org
> > 
> > So basically you want a variant of get_super() that would get you a
> > superblock for this bdev, locked and unfrozen?  Fair enough, but
> > 	* that should be a proper helper in super.c, rather than
> > open-coded in fs/quota/quota.c, of all places
> > 	* what about other existing callers get_super() and its friends?
> 
> Hi
> 
> You can look at that functionality here: I've already made a patch that 
> has it: 
> https://www.redhat.com/archives/dm-devel/2011-November/msg00151.html

Sorry, I accidentally linked to the message you were responding to.

The point is that there are some users of get_super that need to get 
superblock even if it's frozen and other users of get_super that must not 
get a frozen superblock. So I made a bool parameter to distinguish these 
cases. Do you have some other ideas?

Mikulas

> Basically, the patch introduces a function down_read_s_umount, which takes 
> s_umount for read, but makes sure that the filesystem is not frozen. Then, 
> it adds a boolean parameter to get_super() which tells get_super() that it 
> should wait for unfreeze (i.e. call "down_read_s_umount" isntead of 
> "down_read(&sb->s_umount)").
> 
> Mikulas
> 
> > and while we are at it, why in damnation name is it exported?  The only
> > caller outside of core VFS is under #if 0...
> > 
> 




More information about the dm-devel mailing list