* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
@ 2009-01-16 8:33 Coly Li
2009-01-18 15:23 ` Sunil Mushran
2009-10-29 22:19 ` Joel Becker
0 siblings, 2 replies; 6+ messages in thread
From: Coly Li @ 2009-01-16 8:33 UTC (permalink / raw)
To: ocfs2-devel
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.
Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Sunil Mushran <sunil.mushran@oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>
---
fs/ocfs2/super.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 43ed113..c953933 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -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);
--
Coly Li
SuSE Labs
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
2009-01-16 8:33 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4 Coly Li
@ 2009-01-18 15:23 ` Sunil Mushran
2009-01-19 2:18 ` Coly Li
2009-10-29 22:19 ` Joel Becker
1 sibling, 1 reply; 6+ messages in thread
From: Sunil Mushran @ 2009-01-18 15:23 UTC (permalink / raw)
To: ocfs2-devel
f_fsid.val[1] look wrong. Just set it to zero.
On Jan 16, 2009, at 12:33 AM, Coly Li <coly.li@suse.de> wrote:
> 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.
>
> Signed-off-by: Coly Li <coly.li@suse.de>
> Cc: Sunil Mushran <sunil.mushran@oracle.com>
> Cc: Mark Fasheh <mfasheh@suse.com>
> ---
> fs/ocfs2/super.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 43ed113..c953933 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -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);
>
> --
> Coly Li
> SuSE Labs
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
2009-01-18 15:23 ` Sunil Mushran
@ 2009-01-19 2:18 ` Coly Li
2009-01-19 4:57 ` Sunil Mushran
0 siblings, 1 reply; 6+ messages in thread
From: Coly Li @ 2009-01-19 2:18 UTC (permalink / raw)
To: ocfs2-devel
Sunil Mushran Wrote:
> 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.
> On Jan 16, 2009, at 12:33 AM, Coly Li <coly.li@suse.de> wrote:
>
>> 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.
>>
>> Signed-off-by: Coly Li <coly.li@suse.de>
>> Cc: Sunil Mushran <sunil.mushran@oracle.com>
>> Cc: Mark Fasheh <mfasheh@suse.com>
>> ---
>> fs/ocfs2/super.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>> index 43ed113..c953933 100644
>> --- a/fs/ocfs2/super.c
>> +++ b/fs/ocfs2/super.c
>> @@ -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);
>>
>> --
>> Coly Li
>> SuSE Labs
>>
>>
>>
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
2009-01-19 2:18 ` Coly Li
@ 2009-01-19 4:57 ` Sunil Mushran
2009-01-19 5:48 ` Coly Li
0 siblings, 1 reply; 6+ messages in thread
From: Sunil Mushran @ 2009-01-19 4:57 UTC (permalink / raw)
To: ocfs2-devel
Yeah... I was wrong. This should work.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
On Jan 18, 2009, at 6:18 PM, Coly Li <coly.li@suse.de> wrote:
>
>
> Sunil Mushran Wrote:
>> 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.
>
>> On Jan 16, 2009, at 12:33 AM, Coly Li <coly.li@suse.de> wrote:
>>
>>> 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.
>>>
>>> Signed-off-by: Coly Li <coly.li@suse.de>
>>> Cc: Sunil Mushran <sunil.mushran@oracle.com>
>>> Cc: Mark Fasheh <mfasheh@suse.com>
>>> ---
>>> fs/ocfs2/super.c | 4 ++++
>>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>>> index 43ed113..c953933 100644
>>> --- a/fs/ocfs2/super.c
>>> +++ b/fs/ocfs2/super.c
>>> @@ -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);
>>>
>>> --
>>> Coly Li
>>> SuSE Labs
>>>
>>>
>>>
>
> --
> Coly Li
> SuSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
2009-01-19 4:57 ` Sunil Mushran
@ 2009-01-19 5:48 ` Coly Li
0 siblings, 0 replies; 6+ messages in thread
From: Coly Li @ 2009-01-19 5:48 UTC (permalink / raw)
To: ocfs2-devel
Sunil Mushran Wrote:
> Yeah... I was wrong. This should work.
>
> Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
>
Thanks for your review and SOB :)
>
> On Jan 18, 2009, at 6:18 PM, Coly Li <coly.li@suse.de> wrote:
>
>>
>>
>> Sunil Mushran Wrote:
>>> 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.
>>
>>> On Jan 16, 2009, at 12:33 AM, Coly Li <coly.li@suse.de> wrote:
>>>
--
Coly Li
SuSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4
2009-01-16 8:33 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4 Coly Li
2009-01-18 15:23 ` Sunil Mushran
@ 2009-10-29 22:19 ` Joel Becker
1 sibling, 0 replies; 6+ messages in thread
From: Joel Becker @ 2009-10-29 22:19 UTC (permalink / raw)
To: ocfs2-devel
On Fri, Jan 16, 2009 at 04:33:05PM +0800, Coly Li wrote:
> 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.
>
> Signed-off-by: Coly Li <coly.li@suse.de>
> Cc: Sunil Mushran <sunil.mushran@oracle.com>
> Cc: Mark Fasheh <mfasheh@suse.com>
This patch is now in the fixes branch of ocfs2.git.
Joel
--
"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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-10-29 22:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-16 8:33 [Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4 Coly Li
2009-01-18 15:23 ` Sunil Mushran
2009-01-19 2:18 ` Coly Li
2009-01-19 4:57 ` Sunil Mushran
2009-01-19 5:48 ` Coly Li
2009-10-29 22:19 ` Joel Becker
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.