[PATCH] ocfs2: Fix super block reserved field offset comment

yili posted 1 patch 1 month, 4 weeks ago
fs/ocfs2/ocfs2_fs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ocfs2: Fix super block reserved field offset comment
Posted by yili 1 month, 4 weeks ago
The offset annotation for s_reserved2 in struct ocfs2_super_block
was incorrect. After the preceding fields:
- s_xattr_inline_size (2 bytes at 0xB8)
- s_reserved0 (2 bytes at 0xBA)
- s_dx_seed[3] (12 bytes at 0xBC)

The actual offset of s_reserved2 is at 0xC8,
when calculating from the start of the structure.

Correct the offset comment from C0 to C8 to reflect the proper
location in the super block structure.

Signed-off-by: yili <yili@winhong.com>
---
 fs/ocfs2/ocfs2_fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index e8e94599e907..ae0e44e5f2ad 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -614,7 +614,7 @@ struct ocfs2_super_block {
 	__le16 s_reserved0;
 	__le32 s_dx_seed[3];		/* seed[0-2] for dx dir hash.
 					 * s_uuid_hash serves as seed[3]. */
-/*C0*/  __le64 s_reserved2[15];		/* Fill out superblock */
+/*C8*/  __le64 s_reserved2[15];		/* Fill out superblock */
 /*140*/
 
 	/*
-- 
2.43.0
Re: [PATCH] ocfs2: Fix super block reserved field offset comment
Posted by Joel Becker 1 month, 4 weeks ago
Yep.  And 140 - (sizeof(s_reserved2) aka 8 * F) = C8.

Reviewed-by: Joel Becker <jlbec@evilplan.org>

On Thu, Aug 07, 2025 at 11:57:49PM +0800, yili wrote:
> The offset annotation for s_reserved2 in struct ocfs2_super_block
> was incorrect. After the preceding fields:
> - s_xattr_inline_size (2 bytes at 0xB8)
> - s_reserved0 (2 bytes at 0xBA)
> - s_dx_seed[3] (12 bytes at 0xBC)
> 
> The actual offset of s_reserved2 is at 0xC8,
> when calculating from the start of the structure.
> 
> Correct the offset comment from C0 to C8 to reflect the proper
> location in the super block structure.
> 
> Signed-off-by: yili <yili@winhong.com>
> ---
>  fs/ocfs2/ocfs2_fs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
> index e8e94599e907..ae0e44e5f2ad 100644
> --- a/fs/ocfs2/ocfs2_fs.h
> +++ b/fs/ocfs2/ocfs2_fs.h
> @@ -614,7 +614,7 @@ struct ocfs2_super_block {
>  	__le16 s_reserved0;
>  	__le32 s_dx_seed[3];		/* seed[0-2] for dx dir hash.
>  					 * s_uuid_hash serves as seed[3]. */
> -/*C0*/  __le64 s_reserved2[15];		/* Fill out superblock */
> +/*C8*/  __le64 s_reserved2[15];		/* Fill out superblock */
>  /*140*/
>  
>  	/*
> -- 
> 2.43.0
> 

-- 

Life's Little Instruction Book #15

	"Own a great stereo system."

			http://www.jlbec.org/
			jlbec@evilplan.org
Re: [PATCH] ocfs2: Fix super block reserved field offset comment
Posted by Joseph Qi 1 month, 2 weeks ago

On 2025/8/8 03:23, Joel Becker wrote:
> Yep.  And 140 - (sizeof(s_reserved2) aka 8 * F) = C8.
> 
> Reviewed-by: Joel Becker <jlbec@evilplan.org>
> 

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> On Thu, Aug 07, 2025 at 11:57:49PM +0800, yili wrote:
>> The offset annotation for s_reserved2 in struct ocfs2_super_block
>> was incorrect. After the preceding fields:
>> - s_xattr_inline_size (2 bytes at 0xB8)
>> - s_reserved0 (2 bytes at 0xBA)
>> - s_dx_seed[3] (12 bytes at 0xBC)
>>
>> The actual offset of s_reserved2 is at 0xC8,
>> when calculating from the start of the structure.
>>
>> Correct the offset comment from C0 to C8 to reflect the proper
>> location in the super block structure.
>>
>> Signed-off-by: yili <yili@winhong.com>
>> ---
>>  fs/ocfs2/ocfs2_fs.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
>> index e8e94599e907..ae0e44e5f2ad 100644
>> --- a/fs/ocfs2/ocfs2_fs.h
>> +++ b/fs/ocfs2/ocfs2_fs.h
>> @@ -614,7 +614,7 @@ struct ocfs2_super_block {
>>  	__le16 s_reserved0;
>>  	__le32 s_dx_seed[3];		/* seed[0-2] for dx dir hash.
>>  					 * s_uuid_hash serves as seed[3]. */
>> -/*C0*/  __le64 s_reserved2[15];		/* Fill out superblock */
>> +/*C8*/  __le64 s_reserved2[15];		/* Fill out superblock */
>>  /*140*/
>>  
>>  	/*
>> -- 
>> 2.43.0
>>
>