ocfs2: return f_fsid info in ocfs2_statfs()
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
Currently f_fsid of struct kstatfs returned from ocfs2_statfs() is undefined (at least it should be filled with 0). Since in some conditions, f_fsid value might be used as (f_fsid, ino) pare to uniquely identify a file, ocfs2 should return a defined unique f_fsid value from ocfs2_statfs().
This patch uses uuid_hash as a unique ID to initiate f_fsid value, the 32bits width is enough for ocfs2 membership so far.
--- fs/ocfs2/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ocfs2/super.c +2 -0
@@ -1425,6 +1425,8 @@ 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 ] = osb->uuid_hash &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =0 ;brelse (bh);
Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
Wondering whether this id needs to be endian consistent. For failover nfs setups maybe.
Quoted 26 lines · Coly Li
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (at least it should be filled with 0). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pare to uniquely identify a file, ocfs2 should return a defined uniquef_fsidvalue fromocfs2_statfs().This patch uses
uuid_hashas a unique ID to initiatef_fsidvalue, the 32bits width is enough for ocfs2 membership so far.Signed-off-by Coly Li <[email protected]>--- fs/ocfs2/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/ocfs2/super.c +2
-0@@ -1425,6 +1425,8 @@ 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 ] = osb->uuid_hash &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =0 ;brelse (bh);
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
Sunil Mushran Wrote:
Quoted 2 lines
Wondering whether this id needs to be endian consistent. For failover nfs setups maybe.
IMHO, It is. Because osb->uuid_hash is fetched by:
osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);
CMIIW, It should work in nfs failover.
Quoted 34 lines
Quoted 31 lines · Coly Li
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (at least it should be
filled with 0). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pare to
uniquely identify a file, ocfs2 should return a defined uniquef_fsidvalue fromocfs2_statfs().This patch uses
uuid_hashas a unique ID to initiatef_fsidvalue, the 32bits width is enough for
ocfs2 membership so far.Signed-off-by Coly Li <[email protected]>--- fs/ocfs2/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/ocfs2/super.c +2
-0@@ -1425,6 +1425,8 @@ 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 ] = osb->uuid_hash &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =0 ;brelse (bh);
Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
It's worse. As far as I can see, the s_uuid_hash is never populated. So we have two problems. The second issue is urgent as we are using it in xattr.
Quoted 47 lines · Coly Li
Sunil Mushran Wrote:
Quoted 3 lines
Wondering whether this id needs to be endian consistent. For failover nfs setups maybe.
IMHO, It is. Because
osb->uuid_hashis fetched by:osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);CMIIW, It should work in nfs failover.
Quoted 34 lines
Quoted 32 lines · Coly Li
Currently
f_fsidof struct kstatfs returned fromocfs2_statfs()is undefined (at least it should be
filled with 0). Since in some conditions,f_fsidvalue might be used as (f_fsid, ino) pare to
uniquely identify a file, ocfs2 should return a defined uniquef_fsidvalue fromocfs2_statfs().This patch uses
uuid_hashas a unique ID to initiatef_fsidvalue, the 32bits width is enough for
ocfs2 membership so far.Signed-off-by Coly Li <[email protected]>--- fs/ocfs2/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/ocfs2/super.c +2
-0@@ -1425,6 +1425,8 @@ 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 ] = osb->uuid_hash &0xFFFFFFFFUL ; + buf->f_fsid.val[1 ] =0 ;brelse (bh);
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
Quoted 3 lines · Sunil Mushran
It's worse. As far as I can see, the
s_uuid_hashis never populated. So we have two problems. The second issue is urgent as we are using it in xattr.
Well, mkfs.ocfs2/tunefs.ocfs2 is supposed to populate it s_uuid_hash based on the *original* uuid of the file system. We don't dynamically calculate it because uuid might change due to a clone operation, which would then break the hashing of that particular file system.
Since s_uuid_hash is feature specific, I think perhaps we should just use some part of the uuid, which is always populated. For this, I think we could do the same as the o2cb dlm key (which has to also be pretty unique) - crc32_le(uuid).
--Mark
--
Mark Fasheh
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
Quoted 4 lines · Mark Fasheh
Well, mkfs.ocfs2/tunefs.ocfs2 is supposed to populate it
s_uuid_hashbased on the *original* uuid of the file system. We don't dynamically calculate it because uuid might change due to a clone operation, which would then break the hashing of that particular file system.
OK. I missed that bit.
Quoted 4 lines
Since
s_uuid_hashis feature specific, I think perhaps we should just use some part of the uuid, which is always populated. For this, I think we could do the same as the o2cb dlm key (which has to also be pretty unique) -crc32_le(uuid)
I was thinking the same.
Hagmann
[Ocfs2-devel] Integrating OCFS2 and CLVM
Hi
Does anyone work on the integration from clvmd for ocfs2? On the Roadmap it's named as 1.4+
http://oss.oracle.com/osswiki/OCFS2/Roadmap?highlight=(roadmap)
That's really a important Feature in a large enviroment.
Thanks for your Info
Michael Hagmann
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
In reply to Sunil MushranSunil Mushran Wrote:
Quoted 4 lines
It's worse. As far as I can see, the
s_uuid_hashis never populated. So we have two problems. The second issue is urgent as we are using it in xattr.
Thanks for pointing out this :)
I have updated the patch and sent out as v4.
Quoted 12 lines
Quoted 11 lines · Coly Li
Sunil Mushran Wrote:
Quoted 3 lines
Wondering whether this id needs to be endian consistent. For failover nfs setups maybe.
IMHO, It is. Because
osb->uuid_hashis fetched by:osb->uuid_hash = le32_to_cpu(di->id2.i_super.s_uuid_hash);CMIIW, It should work in nfs failover.
[snip]
Signature · 2 lines
Coly Li SuSE Labs
PATCH 1/1 ocfs2: return f_fsid info in ocfs2_statfs()
In reply to Sunil MushranSunil Mushran Wrote:
Quoted 11 lines
Quoted 7 lines · Mark Fasheh
Well, mkfs.ocfs2/tunefs.ocfs2 is supposed to populate it
s_uuid_hashbased
on the *original* uuid of the file system. We don't dynamically calculate it
because uuid might change due to a clone operation, which would then break
the hashing of that particular file system.OK. I missed that bit.
Quoted 7 lines
Quoted 5 lines
Since
s_uuid_hashis feature specific, I think perhaps we should just use some part of the uuid, which is always populated. For this, I think we could
do the same as the o2cb dlm key (which has to also be pretty unique) -crc32_le(uuid)I was thinking the same.
Now I use crc32_le(osb->uuid_str) to generate fsid value. osb->uuid_str is string representation of s_uuid. Since uuid_str is byte-by-byte, the f_fsid value should be endian consistent.
Would you please to review the v4 patch once more ?
Thanks for your comments.
Signature · 2 lines
Coly Li SuSE Labs