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, 22 Aug 2013 05:04:59 +0900 (JST)
From:	Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	Miklos Szeredi <miklos@...redi.hu>, rwheeler@...hat.com,
	avati@...hat.com, bfoster@...hat.com, dhowells@...hat.com,
	eparis@...hat.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, mszeredi@...e.cz, raven@...maw.net
Subject: Re: [PATCH 0/9] [RFC v2] safely drop directory dentry on failed
 revalidate

On Wed, 21 Aug 2013 06:40:56 +0100, Al Viro wrote:
> 	And I would like to understand what nilfs one is trying to do...
> Unless I'm seriously misreading that code, it's *not* on any kind of a hot
> path, so I really wonder why don't we simply do shrink_dcache_parent() +
> check if d_count has dropped to 1, without trying to look for submounts
> first - if we have any, shrink_dcache_parent() is simply going to leave
> us with d_count > 1 and that's it.  Actually, it's cheaper that way -
> no need to walk the tree twice.

> 	We are really getting too many tree walkers in fs/dcache.c and
> all that duplication is the prime breeding ground for bugs ;-/

I agree that we can eliminate have_submounts() from nilfs.  Please
apply the following patch if you hope so.

> Moreover, checking for d_count == 1
> case first is also pointless - in that case we have no children at all
> and shrink_dcache_parent() will return immediately.

This also looks true.  I will confirm whether we can remove the
pre-check for d_count == 1 case.


Regards,
Ryusuke Konishi
--
From: Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>
Date: Thu, 22 Aug 2013 01:53:03 +0900
Subject: [PATCH] nilfs2: do not use have_submounts()

The pre-check with have_submounts() in
nilfs_try_to_shrink_tree(root_dentry) is eliminable since the return
value of the function does not depend on whether the root_dentry has
sub-mounts or not.  Removing the have_submount() pre-check may cause
unnecessary dcache shrinking, but the impact looks limited because
nilfs_try_to_shrink_tree() is not called in usual operation.

So, we remove use of have_submounts() from nilfs.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>
---
 fs/nilfs2/super.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index af3ba04..38fe240 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1007,8 +1007,6 @@ static int nilfs_tree_was_touched(struct dentry *root_dentry)
  */
 static int nilfs_try_to_shrink_tree(struct dentry *root_dentry)
 {
-	if (have_submounts(root_dentry))
-		return true;
 	shrink_dcache_parent(root_dentry);
 	return nilfs_tree_was_touched(root_dentry);
 }
-- 
1.7.9.3

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