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] [day] [month] [year] [list]
Date:	Thu, 21 Jul 2016 12:34:32 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Zhang AiHua <zhangaihua1@...wei.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	"linux-unionfs@...r.kernel.org" <linux-unionfs@...r.kernel.org>
Subject: Re: [PATCH] ovl: support ltp/testcase/bin/inotify04 on overlayfs

On Thu, Jul 21, 2016 at 12:19 PM,  <zhangaihua1@...wei.com> wrote:
> From: Aihua Zhang <zhangaihua1@...wei.com>
>
> after patch:
> [root@...alhost bin]# ./inotify04
> inotify04    1  TPASS  :  got event: wd=1 mask=400 cookie=0 len=0 name=""
> inotify04    2  TPASS  :  got event: wd=1 mask=8000 cookie=0 len=0 name=""
> inotify04    3  TPASS  :  got event: wd=2 mask=4 cookie=0 len=0 name=""
> inotify04    4  TPASS  :  got event: wd=2 mask=400 cookie=0 len=0 name=""
> inotify04    5  TPASS  :  got event: wd=2 mask=8000 cookie=0 len=0 name=""
>
> Signed-off-by: Aihua Zhang <zhangaihua1@...wei.com>
> ---
>  fs/dcache.c          |    8 ++++++--
>  fs/overlayfs/inode.c |    2 +-
>  include/linux/fs.h   |    1 +
>  3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 7654509..0db095d 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -313,7 +313,9 @@ static void dentry_iput(struct dentry * dentry)
>                 hlist_del_init(&dentry->d_u.d_alias);
>                 spin_unlock(&dentry->d_lock);
>                 spin_unlock(&inode->i_lock);
> -               if (!inode->i_nlink)
> +               if ((!inode->i_nlink) ||
> +                       ((inode->i_flags & S_SPECIAL_OVL) &&
> +                       (1 == inode->i_nlink)))


No such horrible hackery is needed if overlay code would correctly
reset i_nlink on rmdir.

See a50128d4524a ("ovl: clear nlink on rmdir") in the overlayfs-next branch of

  git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git

Thanks,
Miklos

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ