* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
@ 2009-01-15 19:07 Coly Li
2009-01-15 19:25 ` Sunil Mushran
0 siblings, 1 reply; 9+ messages in thread
From: Coly Li @ 2009-01-15 19:07 UTC (permalink / raw)
To: ocfs2-devel
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.
Signed-off-by: Coly Li <coly.li@suse.de>
---
fs/ocfs2/super.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 43ed113..fdab98a 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -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);
--
Coly Li
SuSE Labs
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 19:07 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs() Coly Li
@ 2009-01-15 19:25 ` Sunil Mushran
2009-01-15 19:48 ` Coly Li
0 siblings, 1 reply; 9+ messages in thread
From: Sunil Mushran @ 2009-01-15 19:25 UTC (permalink / raw)
To: ocfs2-devel
Wondering whether this id needs to be endian consistent.
For failover nfs setups maybe.
Coly Li wrote:
> 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.
>
> Signed-off-by: Coly Li <coly.li@suse.de>
> ---
> fs/ocfs2/super.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 43ed113..fdab98a 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -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);
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 19:25 ` Sunil Mushran
@ 2009-01-15 19:48 ` Coly Li
2009-01-15 19:59 ` Sunil Mushran
0 siblings, 1 reply; 9+ messages in thread
From: Coly Li @ 2009-01-15 19:48 UTC (permalink / raw)
To: ocfs2-devel
Sunil Mushran Wrote:
> 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.
>
> Coly Li wrote:
>> 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.
>>
>> Signed-off-by: Coly Li <coly.li@suse.de>
>> ---
>> fs/ocfs2/super.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>> index 43ed113..fdab98a 100644
>> --- a/fs/ocfs2/super.c
>> +++ b/fs/ocfs2/super.c
>> @@ -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);
>>
>>
>
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 9+ messages in thread* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 19:48 ` Coly Li
@ 2009-01-15 19:59 ` Sunil Mushran
2009-01-15 22:21 ` Mark Fasheh
2009-01-16 9:19 ` Coly Li
0 siblings, 2 replies; 9+ messages in thread
From: Sunil Mushran @ 2009-01-15 19:59 UTC (permalink / raw)
To: ocfs2-devel
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.
Coly Li wrote:
> Sunil Mushran Wrote:
>
>> 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.
>
>
>> Coly Li wrote:
>>
>>> 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.
>>>
>>> Signed-off-by: Coly Li <coly.li@suse.de>
>>> ---
>>> fs/ocfs2/super.c | 2 ++
>>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>>> index 43ed113..fdab98a 100644
>>> --- a/fs/ocfs2/super.c
>>> +++ b/fs/ocfs2/super.c
>>> @@ -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);
>>>
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 19:59 ` Sunil Mushran
@ 2009-01-15 22:21 ` Mark Fasheh
2009-01-15 22:32 ` Sunil Mushran
2009-01-16 9:19 ` Coly Li
1 sibling, 1 reply; 9+ messages in thread
From: Mark Fasheh @ 2009-01-15 22:21 UTC (permalink / raw)
To: ocfs2-devel
On Thu, Jan 15, 2009 at 11:59:36AM -0800, Sunil Mushran wrote:
> 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.
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 22:21 ` Mark Fasheh
@ 2009-01-15 22:32 ` Sunil Mushran
2009-01-16 0:17 ` [Ocfs2-devel] Integrating OCFS2 and CLVM Hagmann, Michael
2009-01-16 9:23 ` [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs() Coly Li
0 siblings, 2 replies; 9+ messages in thread
From: Sunil Mushran @ 2009-01-15 22:32 UTC (permalink / raw)
To: ocfs2-devel
Mark Fasheh wrote:
> 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.
OK. I missed that bit.
> 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)
I was thinking the same.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Ocfs2-devel] Integrating OCFS2 and CLVM
2009-01-15 22:32 ` Sunil Mushran
@ 2009-01-16 0:17 ` Hagmann, Michael
2009-01-16 9:23 ` [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs() Coly Li
1 sibling, 0 replies; 9+ messages in thread
From: Hagmann, Michael @ 2009-01-16 0:17 UTC (permalink / raw)
To: ocfs2-devel
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 22:32 ` Sunil Mushran
2009-01-16 0:17 ` [Ocfs2-devel] Integrating OCFS2 and CLVM Hagmann, Michael
@ 2009-01-16 9:23 ` Coly Li
1 sibling, 0 replies; 9+ messages in thread
From: Coly Li @ 2009-01-16 9:23 UTC (permalink / raw)
To: ocfs2-devel
Sunil Mushran Wrote:
> Mark Fasheh wrote:
>> 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.
>
> OK. I missed that bit.
>
>> 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)
>
> 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.
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs()
2009-01-15 19:59 ` Sunil Mushran
2009-01-15 22:21 ` Mark Fasheh
@ 2009-01-16 9:19 ` Coly Li
1 sibling, 0 replies; 9+ messages in thread
From: Coly Li @ 2009-01-16 9:19 UTC (permalink / raw)
To: ocfs2-devel
Sunil Mushran Wrote:
> 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.
>
Thanks for pointing out this :)
I have updated the patch and sent out as v4.
> Coly Li wrote:
>> Sunil Mushran Wrote:
>>
>>> 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.
>>
>>
[snip]
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-01-16 9:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 19:07 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs() Coly Li
2009-01-15 19:25 ` Sunil Mushran
2009-01-15 19:48 ` Coly Li
2009-01-15 19:59 ` Sunil Mushran
2009-01-15 22:21 ` Mark Fasheh
2009-01-15 22:32 ` Sunil Mushran
2009-01-16 0:17 ` [Ocfs2-devel] Integrating OCFS2 and CLVM Hagmann, Michael
2009-01-16 9:23 ` [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs() Coly Li
2009-01-16 9:19 ` Coly Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.