Re: [PATCH 02/10] vfs: check submounts and drop atomically
From: Miklos Szeredi
Date: Thu Sep 05 2013 - 05:11:30 EST
On Wed, Sep 4, 2013 at 7:58 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/