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]
Message-Id: <11821073632124-git-send-email-jsipek@cs.sunysb.edu>
Date:	Sun, 17 Jun 2007 15:09:12 -0400
From:	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>
To:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc:	akpm@...ux-foundation.org, Erez Zadok <ezk@...sunysb.edu>,
	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>
Subject: [PATCH 05/16] Unionfs: call statfs on lower file system properly

From: Erez Zadok <ezk@...sunysb.edu>

Get the correct lower dentry to use to statfs the first branch (always),

Signed-off-by: Erez Zadok <ezk@...sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@...sunysb.edu>
---
 fs/unionfs/super.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index b3a5e64..a7ff06c 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -112,18 +112,23 @@ static void unionfs_put_super(struct super_block *sb)
 static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
 	int err	= 0;
-	struct super_block *sb, *hidden_sb;
+	struct super_block *sb;
+	struct dentry *lower_dentry;
 
 	BUG_ON(!is_valid_dentry(dentry));
 
 	sb = dentry->d_sb;
 
-	unionfs_read_lock(sb);
-	hidden_sb = unionfs_lower_super_idx(sb, sbstart(sb));
-	unionfs_read_unlock(sb);
-	err = vfs_statfs(hidden_sb->s_root, buf);
+	lower_dentry = unionfs_lower_dentry(sb->s_root);
+	err = vfs_statfs(lower_dentry, buf);
 
+	/* set return buf to our f/s to avoid confusing user-level utils */
 	buf->f_type = UNIONFS_SUPER_MAGIC;
+
+	/*
+	 * Our maximum file name can is shorter by a few bytes because every
+	 * file name could potentially be whited-out.
+	 */
 	buf->f_namelen -= UNIONFS_WHLEN;
 
 	memset(&buf->f_fsid, 0, sizeof(__kernel_fsid_t));
-- 
1.5.2.rc1.165.gaf9b

-
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