ocfs2: return f_fsid info in ocfs2_statfs(), v4
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs(), v4
Currently f_fsid of struct kstatfs returned from ocfs2_statfs() is undefined (vfs layer fills 0 as default). Since in some conditions, f_fsid value might be used as (f_fsid, ino) pair to uniquely identify a file, ocfs2 should return a unique defined f_fsid value from ocfs2_statfs().
Because uuid_str is identified no mater on big or litlle endian machine, it's also endian consistent to use osb->uuid_str to generate f_fsid value.
--- fs/ocfs2/super.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ocfs2/super.c +4 -0
@@ -1425,6 +1425,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = buf->f_bfree; buf->f_files = numbits; buf->f_ffree = freebits; + buf->f_fsid.val[0 ] =crc32_le (0 , osb->uuid_str,OCFS2_VOL_UUID_LEN ) + &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =crc32_le (0 , osb->uuid_str +OCFS2_VOL_UUID_LEN , +OCFS2_VOL_UUID_LEN ) &0xFFFFFFFFUL ;brelse (bh);
Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs(), v4
f_fsid.val[1] look wrong. Just set it to zero.
Quoted 42 lines · Coly Li
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (vfs layer fills 0 as
default). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pair to
uniquely identify a file, ocfs2 should return a unique definedf_fsidvalue fromocfs2_statfs().Because
uuid_stris identified no mater on big or litlle endian machine, it's also endian consistent
to useosb->uuid_strto generatef_fsidvalue.Signed-off-by Coly Li <[email protected]>Cc Sunil Mushran <[email protected]>Cc Mark Fasheh <[email protected]>---
fs/ocfs2/super.c| 4 ++++1 files changed, 4 insertions(+), 0 deletions(-)fs/ocfs2/super.c +4
-0@@ -1425,6 +1425,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = buf->f_bfree; buf->f_files = numbits; buf->f_ffree = freebits; + buf->f_fsid.val[0 ] =crc32_le (0 , osb->uuid_str,OCFS2_VOL_UUID_LEN ) + &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =crc32_le (0 , osb->uuid_str +OCFS2_VOL_UUID_LEN , +OCFS2_VOL_UUID_LEN ) &0xFFFFFFFFUL ;brelse(bh);Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs(), v4
Sunil Mushran Wrote:
Quoted 2 lines
f_fsid.val[1] look wrong. Just set it to zero.
It's OK to set it to zero. But can you please to explain a little bit why f_fsid.val[1] is wrong ? I tested the code and the f_fsid.val looked well.
Thanks for the review.
Quoted 42 lines · Coly Li
Quoted 41 lines
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (vfs layer fills 0 as
default). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pair to
uniquely identify a file, ocfs2 should return a unique definedf_fsidvalue fromocfs2_statfs().Because
uuid_stris identified no mater on big or litlle endian machine, it's also endian consistent
to useosb->uuid_strto generatef_fsidvalue.Signed-off-by Coly Li <[email protected]>Cc Sunil Mushran <[email protected]>Cc Mark Fasheh <[email protected]>---
fs/ocfs2/super.c| 4 ++++1 files changed, 4 insertions(+), 0 deletions(-)fs/ocfs2/super.c +4
-0@@ -1425,6 +1425,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = buf->f_bfree; buf->f_files = numbits; buf->f_ffree = freebits; + buf->f_fsid.val[0 ] =crc32_le (0 , osb->uuid_str,OCFS2_VOL_UUID_LEN ) + &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =crc32_le (0 , osb->uuid_str +OCFS2_VOL_UUID_LEN , +OCFS2_VOL_UUID_LEN ) &0xFFFFFFFFUL ;brelse (bh);Signature · 3 lines
-- Coly Li SuSE Labs
Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs(), v4
Yeah... I was wrong. This should work.
Quoted 61 lines · Coly Li
Sunil Mushran Wrote:
Quoted 2 lines
f_fsid.val[1] look wrong. Just set it to zero.
It's OK to set it to zero. But can you please to explain a little bit why f_fsid.val[1] is wrong ?
I tested the code and the f_fsid.val looked well.Thanks for the review.
Quoted 46 lines · Coly Li
Quoted 45 lines
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (vfs layer fills 0 as
default). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pair to
uniquely identify a file, ocfs2 should return a unique definedf_fsid
value fromocfs2_statfs().Because
uuid_stris identified no mater on big or litlle endian machine, it's also endian consistent
to useosb->uuid_strto generatef_fsidvalue.Signed-off-by Coly Li <[email protected]>Cc Sunil Mushran <[email protected]>Cc Mark Fasheh <[email protected]>---
fs/ocfs2/super.c| 4 ++++1 files changed, 4 insertions(+), 0 deletions(-)fs/ocfs2/super.c +3
-0@@ -1425,6 +1425,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = buf->f_bfree; buf->f_files = numbits; buf->f_ffree = freebits; + buf->f_fsid.val[0 ] =crc32_le (0 , osb->uuid_str,OCFS2_VOL_UUID_LEN ) + &0xFFFFFFFFUL ; + buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str +
OCFS2_VOL_UUID_LEN,
+OCFS2_VOL_UUID_LEN) &0xFFFFFFFFUL;brelse(bh);Signature · 2 lines
Coly Li SuSE LabsSignature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs(), v4
Sunil Mushran Wrote:
Quoted 4 lines
Yeah... I was wrong. This should work.
Signed-off-by Sunil Mushran <[email protected]>
Thanks for your review and SOB :)
Quoted 16 lines · Coly Li
Quoted 14 lines
Sunil Mushran Wrote:
Quoted 2 lines
f_fsid.val[1] look wrong. Just set it to zero.
It's OK to set it to zero. But can you please to explain a little bit why f_fsid.val[1] is wrong ?
I tested the code and the f_fsid.val looked well.Thanks for the review.
Quoted 2 lines · Coly Li
Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs(), v4
In reply to Coly LiQuoted 10 lines · Coly Li
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (vfs layer fills 0 as default). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pair to uniquely identify a file, ocfs2 should return a unique definedf_fsidvalue fromocfs2_statfs().Because
uuid_stris identified no mater on big or litlle endian machine, it's also endian consistent to useosb->uuid_strto generatef_fsidvalue.Signed-off-by Coly Li <[email protected]>Cc Sunil Mushran <[email protected]>Cc Mark Fasheh <[email protected]>
This patch is now in the fixes branch of ocfs2.git.
Joel
Signature · 9 lines
"The doctrine of human equality reposes on this: that there is no man really clever who has not found that he is stupid." - Gilbert K. Chesterson Joel Becker Principal Software Developer Oracle E-mail: joel.becker at oracle.com Phone: (650) 506-8127