Re: [PATCH v2] btrfs: fix endianness compatibility during the SB RW

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 14, 2018 at 10:53:19PM +0800, Anand Jain wrote:
> 
> 
> On 02/14/2018 01:55 AM, David Sterba wrote:
> > On Tue, Feb 13, 2018 at 06:27:13PM +0800, Anand Jain wrote:
> >> On 02/13/2018 05:01 PM, Qu Wenruo wrote:
> >>> On 2018年02月13日 11:00, Anand Jain wrote:
> >>>> Fixes the endianness bug in the fs_info::super_copy by using its
> >>>> btrfs_set_super...() function to set values in the SB, as these
> >>>> functions manage the endianness compatibility nicely.
> >>>>
> >>>> Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
> >>>
> >>> Also went through all btrfs_super_block SETGET functions, greping using
> >>> \><member name>, seems that there are still some left here:
> >>>
> >>> fs/btrfs/sysfs.c:
> >>> In both btrfs_sectorsize_show() and btrfs_clone_alignment_show():
> >>> 	return snprintf(buf, PAGE_SIZE, "%u\n",
> >>> 			fs_info->super_copy->sectorsize);
> >>>
> >>> In btrfs_nodesize_show():
> >>> 	return snprintf(buf, PAGE_SIZE, "%u\n", fs_info->super_copy->nodesize);
> 
>   Thinking again on the printf they are fine without the endianness
>   functions, because it is printing the values from the memory to
>   buf/stdout, which was previously read from the disk (which
>   possibly written by the opposite endianness system). Here, there
>   is no endianness changes that will be required for it to be written
>   out using printf.

We need to fix the value for printf for the same reason this patch was
needed:

https://git.kernel.org/linus/bea7eafdbda3ba1d4b2ccb9cca829eefb7989bb9

and we can actually use the fs_info-> copies here too.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux