[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] Re: [PATCH 2.6.19 5/5] fs: freeze_bdev with semaphore not mutex



Rafael J. Wysocki wrote:
> On Tuesday, 7 November 2006 23:45, Eric Sandeen wrote:
>> Andrew Morton wrote:
>>
>>>> --- linux-2.6.19-rc4.orig/fs/buffer.c	2006-11-07 17:06:20.000000000 +0000
>>>> +++ linux-2.6.19-rc4/fs/buffer.c	2006-11-07 17:26:04.000000000 +0000
>>>> @@ -188,7 +188,9 @@ struct super_block *freeze_bdev(struct b
>>>>  {
>>>>  	struct super_block *sb;
>>>>  
>>>> -	mutex_lock(&bdev->bd_mount_mutex);
>>>> +	if (down_trylock(&bdev->bd_mount_sem))
>>>> +		return -EBUSY;
>>>> +
>>> This is a functional change which isn't described in the changelog.  What's
>>> happening here?
>> Only allow one bdev-freezer in at a time, rather than queueing them up?
> 
> But freeze_bdev() is supposed to return the result of get_super(bdev)
> _unconditionally_.  Moreover, in its current form freeze_bdev() _cannot_
> _fail_, so I don't see how this change doesn't break any existing code.

Well, it could return NULL.  Is that a failure?

But, nobody is checking for an outright error, certainly.  Especially
when the error hasn't been ERR_PTR'd.  :)  So I agree, that's not so good.

But, how is a stampede of fs-freezers -supposed- to work?  I could
imagine something like a freezer count, and the filesystem is only
unfrozen after everyone has thawed?  Or should only one freezer be
active at a time... which is what we have now I guess.

-Eric


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]