btrfs: fix upper limit for max_inline for page size 64K
authorAnand Jain <anand.jain@oracle.com>
Tue, 10 Aug 2021 15:23:44 +0000 (23:23 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Sep 2021 12:28:46 +0000 (14:28 +0200)
commit6f93e834fa7c5faa0372e46828b4b2a966ac61d7
tree280fe6ddf67af85997344e5bb515a90ea25ceefd
parent0d977e0eba234e01a60bdde27314dc21374201b3
btrfs: fix upper limit for max_inline for page size 64K

The mount option max_inline ranges from 0 to the sectorsize (which is
now equal to page size). But we parse the mount options too early and
before the actual sectorsize is read from the superblock. So the upper
limit of max_inline is unaware of the actual sectorsize and is limited
by the temporary sectorsize 4096, even on a system where the default
sectorsize is 64K.

Fix this by reading the superblock sectorsize before the mount option
parse.

Reported-by: Alexander Tsvetkov <alexander.tsvetkov@oracle.com>
CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c