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:	Mon, 30 Nov 2009 01:26:53 -0500
From:	Erez Zadok <ezk@...sunysb.edu>
To:	Valerie Aurora <vaurora@...hat.com>
Cc:	Jan Blunck <jblunck@...e.de>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christoph Hellwig <hch@...radead.org>,
	Andy Whitcroft <apw@...onical.com>,
	Scott James Remnant <scott@...onical.com>,
	Sandu Popa Marius <sandupopamarius@...il.com>,
	Jan Rekorajski <baggins@...h.mimuw.edu.pl>,
	"J. R. Okajima" <hooanon05@...oo.co.jp>,
	Arnd Bergmann <arnd@...db.de>,
	Vladimir Dronnikov <dronnikov@...il.com>,
	Felix Fietkau <nbd@...nwrt.org>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, David Woodhouse <dwmw2@...radead.org>
Subject: Re: [PATCH 13/41] whiteout: tmpfs whiteout support 

In message <1256152779-10054-14-git-send-email-vaurora@...hat.com>, Valerie Aurora writes:
> From: Jan Blunck <jblunck@...e.de>
> 
> Add support for whiteout dentries to tmpfs.

Shouldn't you CC Hugh Dickins here?  He's probably best positioned to review
the changes in mm/shmem.c.

> XXX - Not sure this is the right patch to put the code for supporting
> whiteouts in d_genocide().
> 
> Signed-off-by: Jan Blunck <jblunck@...e.de>
> Signed-off-by: David Woodhouse <dwmw2@...radead.org>
> Signed-off-by: Valerie Aurora <vaurora@...hat.com>
> ---
>  fs/dcache.c |    3 +-
>  mm/shmem.c  |  149 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
>  2 files changed, 137 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 0fcae4b..1fae1df 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -2280,7 +2280,8 @@ resume:
>  		struct list_head *tmp = next;
>  		struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
>  		next = tmp->next;
> -		if (d_unhashed(dentry)||!dentry->d_inode)
> +		if (d_unhashed(dentry)||(!dentry->d_inode &&
> +					 !d_is_whiteout(dentry)))

I think this d_genocide patch should go elsewhere.  What does it have to do
with tmpfs?

Also, is your logic above correct?  If I understood d_genocide correctly,
then the code you changed attempts to skip over dentries for which
d_genocide has no work to do, like unhashed and negative dentries.  So I
assume it should also skip over whiteout dentries.  Your condition is

if (d_unhashed(dentry) || (!dentry->d_inode && !d_is_whiteout(dentry)))

but perhaps it needs to be

if (d_unhashed(dentry) || !dentry->d_inode || d_is_whiteout(dentry))

No?

Either way, you may want to document any complex conditional that may be
confusing to parse.

>  			continue;
>  		if (!list_empty(&dentry->d_subdirs)) {
>  			this_parent = dentry;
> diff --git a/mm/shmem.c b/mm/shmem.c
> index d713239..2faa14b 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
[mm/shmem.c changes snipped]

Erez.
--
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