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>] [day] [month] [year] [list]
Date:	Fri, 7 Mar 2014 22:51:47 +0100
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Cc:	sage <sage@...tank.com>, akpm <akpm@...ux-foundation.org>
Subject: [PATCH 1/1 linux-next] fs/ceph/super.c: Undefined field set to 0 +
 clean-up

-statfs(2) /undefined
-Don't recalculate f_frsize and f_bavail.
-Remove ?? comment.
-Use defined CEPH_BLOCK.
-Directly work with >> 12 for 4Kb conversions (like in dir.c)

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 fs/ceph/super.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 10a4ccb..7ceecd8 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -67,7 +67,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
 		return err;
 
 	/* fill in kstatfs */
-	buf->f_type = CEPH_SUPER_MAGIC;  /* ?? */
+	buf->f_type = CEPH_SUPER_MAGIC;
 
 	/*
 	 * express utilization in terms of large blocks to avoid
@@ -78,14 +78,14 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
 	 * Someday, we will probably want to report a real block
 	 * size...  whatever that may mean for a network file system!
 	 */
-	buf->f_bsize = 1 << CEPH_BLOCK_SHIFT;
-	buf->f_frsize = 1 << CEPH_BLOCK_SHIFT;
-	buf->f_blocks = le64_to_cpu(st.kb) >> (CEPH_BLOCK_SHIFT-10);
-	buf->f_bfree = le64_to_cpu(st.kb_avail) >> (CEPH_BLOCK_SHIFT-10);
-	buf->f_bavail = le64_to_cpu(st.kb_avail) >> (CEPH_BLOCK_SHIFT-10);
+	buf->f_bsize = CEPH_BLOCK;
+	buf->f_frsize = buf->f_bsize;
+	buf->f_blocks = le64_to_cpu(st.kb) >> 12;
+	buf->f_bfree = le64_to_cpu(st.kb_avail) >> 12;
+	buf->f_bavail = buf->f_bfree;
 
 	buf->f_files = le64_to_cpu(st.num_objects);
-	buf->f_ffree = -1;
+	buf->f_ffree = 0;
 	buf->f_namelen = NAME_MAX;
 
 	/* leave fsid little-endian, regardless of host endianness */
-- 
1.8.1.4
--
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