Messages in this thread | | | Date | Thu, 5 Sep 2013 11:11:23 +0200 | Subject | Re: [PATCH 02/10] vfs: check submounts and drop atomically | From | Miklos Szeredi <> |
| |
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
| |