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 02:51:05 -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>,
	linux-mtd@...ts.infradead.org
Subject: Re: [PATCH 16/41] whiteout: jffs2 whiteout support 

In message <1256152779-10054-17-git-send-email-vaurora@...hat.com>, Valerie Aurora writes:
> From: Felix Fietkau <nbd@...nwrt.org>
> 
> Add support for whiteout dentries to jffs2.
> 
> Signed-off-by: Felix Fietkau <nbd@...nwrt.org>
> Signed-off-by: Valerie Aurora <vaurora@...hat.com>
> Cc: David Woodhouse <dwmw2@...radead.org>
> Cc: linux-mtd@...ts.infradead.org
> ---
>  fs/jffs2/dir.c        |   77 +++++++++++++++++++++++++++++++++++++++++++++++-
>  fs/jffs2/fs.c         |    4 ++
>  fs/jffs2/super.c      |    2 +-
>  include/linux/jffs2.h |    2 +
>  4 files changed, 82 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
> index 6f60cc9..46a2e1b 100644
> --- a/fs/jffs2/dir.c
> +++ b/fs/jffs2/dir.c
> @@ -34,6 +34,8 @@ static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t);
>  static int jffs2_rename (struct inode *, struct dentry *,
>  			 struct inode *, struct dentry *);
>  
> +static int jffs2_whiteout (struct inode *, struct dentry *, struct dentry *);
> +
>  const struct file_operations jffs2_dir_operations =
>  {
>  	.read =		generic_read_dir,
> @@ -55,6 +57,7 @@ const struct inode_operations jffs2_dir_inode_operations =
>  	.rmdir =	jffs2_rmdir,
>  	.mknod =	jffs2_mknod,
>  	.rename =	jffs2_rename,
> +	.whiteout =     jffs2_whiteout,
>  	.permission =	jffs2_permission,
>  	.setattr =	jffs2_setattr,
>  	.setxattr =	jffs2_setxattr,
> @@ -98,8 +101,18 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,
>  			fd = fd_list;
>  		}
>  	}
> -	if (fd)
> -		ino = fd->ino;
> +	if (fd) {
> +		spin_lock(&target->d_lock);
> +		switch(fd->type) {
> +		case DT_WHT:
> +			target->d_flags |= DCACHE_WHITEOUT;
> +			break;
> +		default:
> +			ino = fd->ino;
> +			break;
> +		}
> +		spin_unlock(&target->d_lock);
> +	}

The switch statement above should be simplified into this:

 if (fd->type == DT_WHT)
	target->d_flags |= DCACHE_WHITEOUT;
 else
	ino = fd->ino;

> +	/* If it's a directory, then check whether it is really empty
> +	 */

Format above comment on one line.

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