]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: make mb_optimize_scan option work with set/unset mount cmd
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Tue, 8 Mar 2022 09:52:00 +0000 (15:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:25 +0000 (13:57 +0200)
commit7519d7b127457550c026a02d7044162af510b5b1
tree105358e32c8f29d6e38922076f8da84ccd47f0e2
parent988fbad2ee18c01c23cec5f66200387303246030
ext4: make mb_optimize_scan option work with set/unset mount cmd

commit 27b38686a3bb601db48901dbc4e2fc5d77ffa2c1 upstream.

After moving to the new mount API, mb_optimize_scan mount option
handling was not working as expected due to the parsed value always
being overwritten by default. Refactor and fix this to the expected
behavior described below:

*  mb_optimize_scan=1 - On
*  mb_optimize_scan=0 - Off
*  mb_optimize_scan not passed - On if no. of BGs > threshold else off
*  Remounts retain previous value unless we explicitly pass the option
   with a new value

Fixes: cebe85d570cf ("ext4: switch to the new mount api")
Cc: stable@kernel.org
Reported-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/c98970fe99f26718586d02e942f293300fb48ef3.1646732698.git.ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/super.c