lkml.org 
[lkml]   [2013]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 02/10] vfs: check submounts and drop atomically
From
On Wed, Sep 4, 2013 at 7:58 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Wed, Sep 04, 2013 at 04:05:48PM +0200, Miklos Szeredi wrote:
>
>> +static void check_and_drop(void *_data, struct dentry *dentry)
>> +{
>> + struct select_data *data = _data;
>> +
>> + /* We're only interested in the root of this subtree */
>> + if (data->start == dentry) {
>> + if (d_mountpoint(dentry))
>> + data->found = -EBUSY;
>> + if (!data->found)
>> + __d_drop(dentry);
>> + }
>> +}
>
> Wouldn't it be better to do that in caller?

It needs to stay under d_lock. Moving the unlock to caller would be
rather awkward (if we quit walking the start dentry is not even
locked, etc..) So instead of a ->leave() callback, I just added a
->finish() callback which is called once, when the walk was finished
successfully.

Fixed your other comments too. I'll do a quick testing and then post
the changed patches.

Thanks,
Miklos


\
 
 \ /
  Last update: 2013-09-05 11:21    [W:0.134 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site