Re: [PATCH 02/10] vfs: check submounts and drop atomically

2013-09-05 Thread Miklos Szeredi
On Wed, Sep 4, 2013 at 7:58 PM, Al Viro 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

Re: [PATCH 02/10] vfs: check submounts and drop atomically

2013-09-04 Thread Al Viro
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) { > +

[PATCH 02/10] vfs: check submounts and drop atomically

2013-09-04 Thread Miklos Szeredi
From: Miklos Szeredi We check submounts before doing d_drop() on a non-empty directory dentry in NFS (have_submounts()), but we do not exclude a racing mount. Process A: have_submounts() -> returns false Process B: mount() -> success Process A: d_drop() This patch prepares the ground for the