]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:41:43 +0000 (13:41 +0200)
commit0783695db9fd117ceccb20ab32b4f650869170cb
tree09d07cbc8c97fb0c5bcec823dd94a60ca17fb3a4
parent83cfed28c559b7009cbb4228ddd46836c3a8d24e
btrfs: fix upper limit for max_inline for page size 64K

commit 6f93e834fa7c5faa0372e46828b4b2a966ac61d7 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c