lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 5 Sep 2013 11:11:23 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Al Viro <viro@...iv.linux.org.uk>
Cc:	Ric Wheeler <rwheeler@...hat.com>, Anand Avati <avati@...hat.com>,
	Brian Foster <bfoster@...hat.com>,
	David Howells <dhowells@...hat.com>,
	Eric Paris <eparis@...hat.com>, Ian Kent <raven@...maw.net>,
	Linux-Fsdevel <linux-fsdevel@...r.kernel.org>,
	Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"mszeredi@...e.cz" <mszeredi@...e.cz>,
	Steven Whitehouse <swhiteho@...hat.com>,
	Trond Myklebust <Trond.Myklebust@...app.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 02/10] vfs: check submounts and drop atomically

On Wed, Sep 4, 2013 at 7:58 PM, Al Viro <viro@...iv.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ