* [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount
@ 2022-05-16 6:26 Qu Wenruo
2022-05-16 15:05 ` Josef Bacik
2022-05-18 4:58 ` [kbuild] " Dan Carpenter
0 siblings, 2 replies; 4+ messages in thread
From: Qu Wenruo @ 2022-05-16 6:26 UTC (permalink / raw)
To: linux-btrfs
Upstream commit 9f73f1aef98b ("btrfs: force v2 space cache usage for
subpage mount") forces subpage mount to use v2 cache, to avoid
deprecated v1 cache which doesn't support subpage properly.
But there is a loophole that user can still remount to v1 cache.
The existing check will only give users a warning, but not really
prevents the users to do the remount.
Although remounting to v1 will not cause any problems since the v1 cache
will always be marked invalid when mounted with a different page size,
it's still better to prevent v1 cache at all for subpage mounts.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/super.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index b1fdc6a26c76..1617528a3367 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1985,6 +1985,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
if (ret)
goto restore;
+ /* V1 cache is not supported for subpage mount. */
+ if (fs_info->sectorsize < PAGE_SIZE &&
+ btrfs_test_opt(fs_info, SPACE_CACHE)) {
+ btrfs_warn(fs_info,
+ "v1 space cache is not supported for page size %lu with sectorsize %u",
+ PAGE_SIZE, fs_info->sectorsize);
+ goto restore;
+ }
btrfs_remount_begin(fs_info, old_opts, *flags);
btrfs_resize_thread_pool(fs_info,
fs_info->thread_pool_size, old_thread_pool_size);
--
2.36.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount
2022-05-16 6:26 [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount Qu Wenruo
@ 2022-05-16 15:05 ` Josef Bacik
2022-05-17 0:27 ` Qu Wenruo
2022-05-18 4:58 ` [kbuild] " Dan Carpenter
1 sibling, 1 reply; 4+ messages in thread
From: Josef Bacik @ 2022-05-16 15:05 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs
On Mon, May 16, 2022 at 02:26:53PM +0800, Qu Wenruo wrote:
> Upstream commit 9f73f1aef98b ("btrfs: force v2 space cache usage for
> subpage mount") forces subpage mount to use v2 cache, to avoid
> deprecated v1 cache which doesn't support subpage properly.
>
> But there is a loophole that user can still remount to v1 cache.
>
> The existing check will only give users a warning, but not really
> prevents the users to do the remount.
>
> Although remounting to v1 will not cause any problems since the v1 cache
> will always be marked invalid when mounted with a different page size,
> it's still better to prevent v1 cache at all for subpage mounts.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> fs/btrfs/super.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index b1fdc6a26c76..1617528a3367 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1985,6 +1985,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
> if (ret)
> goto restore;
>
> + /* V1 cache is not supported for subpage mount. */
> + if (fs_info->sectorsize < PAGE_SIZE &&
> + btrfs_test_opt(fs_info, SPACE_CACHE)) {
> + btrfs_warn(fs_info,
> + "v1 space cache is not supported for page size %lu with sectorsize %u",
> + PAGE_SIZE, fs_info->sectorsize);
Shouldn't we be doing ret = -EINVAL; here? Thanks,
Josef
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount
2022-05-16 15:05 ` Josef Bacik
@ 2022-05-17 0:27 ` Qu Wenruo
0 siblings, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2022-05-17 0:27 UTC (permalink / raw)
To: Josef Bacik, Qu Wenruo; +Cc: linux-btrfs
On 2022/5/16 23:05, Josef Bacik wrote:
> On Mon, May 16, 2022 at 02:26:53PM +0800, Qu Wenruo wrote:
>> Upstream commit 9f73f1aef98b ("btrfs: force v2 space cache usage for
>> subpage mount") forces subpage mount to use v2 cache, to avoid
>> deprecated v1 cache which doesn't support subpage properly.
>>
>> But there is a loophole that user can still remount to v1 cache.
>>
>> The existing check will only give users a warning, but not really
>> prevents the users to do the remount.
>>
>> Although remounting to v1 will not cause any problems since the v1 cache
>> will always be marked invalid when mounted with a different page size,
>> it's still better to prevent v1 cache at all for subpage mounts.
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>> fs/btrfs/super.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
>> index b1fdc6a26c76..1617528a3367 100644
>> --- a/fs/btrfs/super.c
>> +++ b/fs/btrfs/super.c
>> @@ -1985,6 +1985,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
>> if (ret)
>> goto restore;
>>
>> + /* V1 cache is not supported for subpage mount. */
>> + if (fs_info->sectorsize < PAGE_SIZE &&
>> + btrfs_test_opt(fs_info, SPACE_CACHE)) {
>> + btrfs_warn(fs_info,
>> + "v1 space cache is not supported for page size %lu with sectorsize %u",
>> + PAGE_SIZE, fs_info->sectorsize);
>
> Shouldn't we be doing ret = -EINVAL; here? Thanks,
>
> Josef
Oh, forgot that.
Thanks for catching it,
Qu
^ permalink raw reply [flat|nested] 4+ messages in thread
* [kbuild] Re: [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount
2022-05-16 6:26 [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount Qu Wenruo
2022-05-16 15:05 ` Josef Bacik
@ 2022-05-18 4:58 ` Dan Carpenter
1 sibling, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-05-18 4:58 UTC (permalink / raw)
To: kbuild, Qu Wenruo, linux-btrfs; +Cc: lkp, kbuild-all
Hi Qu,
url: https://github.com/intel-lab-lkp/linux/commits/Qu-Wenruo/btrfs-prevent-remounting-to-v1-space-cache-for-subpage-mount/20220516-142802
base: https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: i386-randconfig-m021-20220516 (https://download.01.org/0day-ci/archive/20220517/202205172208.qdyoDwJs-lkp@intel.com/config )
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
fs/btrfs/super.c:1994 btrfs_remount() warn: missing error code 'ret'
vim +/ret +1994 fs/btrfs/super.c
c146afad2c7fea Yan Zheng 2008-11-12 1959 static int btrfs_remount(struct super_block *sb, int *flags, char *data)
c146afad2c7fea Yan Zheng 2008-11-12 1960 {
815745cf3e4668 Al Viro 2011-11-17 1961 struct btrfs_fs_info *fs_info = btrfs_sb(sb);
49b25e0540904b Jeff Mahoney 2012-03-01 1962 unsigned old_flags = sb->s_flags;
49b25e0540904b Jeff Mahoney 2012-03-01 1963 unsigned long old_opts = fs_info->mount_opt;
49b25e0540904b Jeff Mahoney 2012-03-01 1964 unsigned long old_compress_type = fs_info->compress_type;
49b25e0540904b Jeff Mahoney 2012-03-01 1965 u64 old_max_inline = fs_info->max_inline;
f7b885befd05fa Anand Jain 2018-02-13 1966 u32 old_thread_pool_size = fs_info->thread_pool_size;
d612ac59efc3b5 Anand Jain 2018-02-26 1967 u32 old_metadata_ratio = fs_info->metadata_ratio;
c146afad2c7fea Yan Zheng 2008-11-12 1968 int ret;
c146afad2c7fea Yan Zheng 2008-11-12 1969
02b9984d640873 Theodore Ts'o 2014-03-13 1970 sync_filesystem(sb);
88c4703f00a9e8 Johannes Thumshirn 2020-07-23 1971 set_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state);
dc81cdc58ad2f4 Miao Xie 2013-02-20 1972
f667aef6af626d Qu Wenruo 2014-09-23 1973 if (data) {
204cc0ccf1d49c Al Viro 2018-12-13 1974 void *new_sec_opts = NULL;
f667aef6af626d Qu Wenruo 2014-09-23 1975
a65001e8a4d465 Al Viro 2018-12-10 1976 ret = security_sb_eat_lsm_opts(data, &new_sec_opts);
a65001e8a4d465 Al Viro 2018-12-10 1977 if (!ret)
204cc0ccf1d49c Al Viro 2018-12-13 1978 ret = security_sb_remount(sb, new_sec_opts);
f667aef6af626d Qu Wenruo 2014-09-23 1979 security_free_mnt_opts(&new_sec_opts);
a65001e8a4d465 Al Viro 2018-12-10 1980 if (ret)
f667aef6af626d Qu Wenruo 2014-09-23 1981 goto restore;
f667aef6af626d Qu Wenruo 2014-09-23 1982 }
f667aef6af626d Qu Wenruo 2014-09-23 1983
2ff7e61e0d30ff Jeff Mahoney 2016-06-22 1984 ret = btrfs_parse_options(fs_info, data, *flags);
891f41cb27cf50 Chengguang Xu 2018-05-09 1985 if (ret)
49b25e0540904b Jeff Mahoney 2012-03-01 1986 goto restore;
b288052e177926 Chris Mason 2009-02-12 1987
fd847878aa1f3c Qu Wenruo 2022-05-16 1988 /* V1 cache is not supported for subpage mount. */
fd847878aa1f3c Qu Wenruo 2022-05-16 1989 if (fs_info->sectorsize < PAGE_SIZE &&
fd847878aa1f3c Qu Wenruo 2022-05-16 1990 btrfs_test_opt(fs_info, SPACE_CACHE)) {
fd847878aa1f3c Qu Wenruo 2022-05-16 1991 btrfs_warn(fs_info,
fd847878aa1f3c Qu Wenruo 2022-05-16 1992 "v1 space cache is not supported for page size %lu with sectorsize %u",
fd847878aa1f3c Qu Wenruo 2022-05-16 1993 PAGE_SIZE, fs_info->sectorsize);
fd847878aa1f3c Qu Wenruo 2022-05-16 @1994 goto restore;
Set an error code on this path?
fd847878aa1f3c Qu Wenruo 2022-05-16 1995 }
f42a34b2f10c41 Miao Xie 2013-04-11 1996 btrfs_remount_begin(fs_info, old_opts, *flags);
0d2450abfa359f Sergei Trofimovich 2012-04-24 1997 btrfs_resize_thread_pool(fs_info,
0d2450abfa359f Sergei Trofimovich 2012-04-24 1998 fs_info->thread_pool_size, old_thread_pool_size);
0d2450abfa359f Sergei Trofimovich 2012-04-24 1999
c55a4319c4f2c3 Boris Burkov 2021-02-23 2000 if ((bool)btrfs_test_opt(fs_info, FREE_SPACE_TREE) !=
c55a4319c4f2c3 Boris Burkov 2021-02-23 2001 (bool)btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) &&
2838d255cb9b85 Boris Burkov 2020-11-18 2002 (!sb_rdonly(sb) || (*flags & SB_RDONLY))) {
2838d255cb9b85 Boris Burkov 2020-11-18 2003 btrfs_warn(fs_info,
2838d255cb9b85 Boris Burkov 2020-11-18 2004 "remount supports changing free space tree only from ro to rw");
2838d255cb9b85 Boris Burkov 2020-11-18 2005 /* Make sure free space cache options match the state on disk */
2838d255cb9b85 Boris Burkov 2020-11-18 2006 if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
2838d255cb9b85 Boris Burkov 2020-11-18 2007 btrfs_set_opt(fs_info->mount_opt, FREE_SPACE_TREE);
2838d255cb9b85 Boris Burkov 2020-11-18 2008 btrfs_clear_opt(fs_info->mount_opt, SPACE_CACHE);
2838d255cb9b85 Boris Burkov 2020-11-18 2009 }
2838d255cb9b85 Boris Burkov 2020-11-18 2010 if (btrfs_free_space_cache_v1_active(fs_info)) {
2838d255cb9b85 Boris Burkov 2020-11-18 2011 btrfs_clear_opt(fs_info->mount_opt, FREE_SPACE_TREE);
2838d255cb9b85 Boris Burkov 2020-11-18 2012 btrfs_set_opt(fs_info->mount_opt, SPACE_CACHE);
2838d255cb9b85 Boris Burkov 2020-11-18 2013 }
2838d255cb9b85 Boris Burkov 2020-11-18 2014 }
2838d255cb9b85 Boris Burkov 2020-11-18 2015
1751e8a6cb935e Linus Torvalds 2017-11-27 2016 if ((bool)(*flags & SB_RDONLY) == sb_rdonly(sb))
dc81cdc58ad2f4 Miao Xie 2013-02-20 2017 goto out;
This looks like a success path so that's fine.
c146afad2c7fea Yan Zheng 2008-11-12 2018
1751e8a6cb935e Linus Torvalds 2017-11-27 2019 if (*flags & SB_RDONLY) {
8dabb7420f014a Stefan Behrens 2012-11-06 2020 /*
8dabb7420f014a Stefan Behrens 2012-11-06 2021 * this also happens on 'umount -rf' or on shutdown, when
8dabb7420f014a Stefan Behrens 2012-11-06 2022 * the filesystem is busy.
8dabb7420f014a Stefan Behrens 2012-11-06 2023 */
21c7e75654b77b Miao Xie 2014-05-13 2024 cancel_work_sync(&fs_info->async_reclaim_work);
5705674081cee7 Josef Bacik 2020-07-21 2025 cancel_work_sync(&fs_info->async_data_reclaim_work);
361c093d7f99c3 Stefan Behrens 2013-10-11 2026
b0643e59cfa609 Dennis Zhou 2019-12-13 2027 btrfs_discard_cleanup(fs_info);
b0643e59cfa609 Dennis Zhou 2019-12-13 2028
361c093d7f99c3 Stefan Behrens 2013-10-11 2029 /* wait for the uuid_scan task to finish */
361c093d7f99c3 Stefan Behrens 2013-10-11 2030 down(&fs_info->uuid_tree_rescan_sem);
361c093d7f99c3 Stefan Behrens 2013-10-11 2031 /* avoid complains from lockdep et al. */
361c093d7f99c3 Stefan Behrens 2013-10-11 2032 up(&fs_info->uuid_tree_rescan_sem);
361c093d7f99c3 Stefan Behrens 2013-10-11 2033
a0a1db70df5f48 Filipe Manana 2020-12-14 2034 btrfs_set_sb_rdonly(sb);
c146afad2c7fea Yan Zheng 2008-11-12 2035
e44163e177960e Jeff Mahoney 2015-06-15 2036 /*
1751e8a6cb935e Linus Torvalds 2017-11-27 2037 * Setting SB_RDONLY will put the cleaner thread to
e44163e177960e Jeff Mahoney 2015-06-15 2038 * sleep at the next loop if it's already active.
e44163e177960e Jeff Mahoney 2015-06-15 2039 * If it's already asleep, we'll leave unused block
e44163e177960e Jeff Mahoney 2015-06-15 2040 * groups on disk until we're mounted read-write again
e44163e177960e Jeff Mahoney 2015-06-15 2041 * unless we clean them up here.
e44163e177960e Jeff Mahoney 2015-06-15 2042 */
e44163e177960e Jeff Mahoney 2015-06-15 2043 btrfs_delete_unused_bgs(fs_info);
e44163e177960e Jeff Mahoney 2015-06-15 2044
a0a1db70df5f48 Filipe Manana 2020-12-14 2045 /*
a0a1db70df5f48 Filipe Manana 2020-12-14 2046 * The cleaner task could be already running before we set the
a0a1db70df5f48 Filipe Manana 2020-12-14 2047 * flag BTRFS_FS_STATE_RO (and SB_RDONLY in the superblock).
a0a1db70df5f48 Filipe Manana 2020-12-14 2048 * We must make sure that after we finish the remount, i.e. after
a0a1db70df5f48 Filipe Manana 2020-12-14 2049 * we call btrfs_commit_super(), the cleaner can no longer start
a0a1db70df5f48 Filipe Manana 2020-12-14 2050 * a transaction - either because it was dropping a dead root,
a0a1db70df5f48 Filipe Manana 2020-12-14 2051 * running delayed iputs or deleting an unused block group (the
a0a1db70df5f48 Filipe Manana 2020-12-14 2052 * cleaner picked a block group from the list of unused block
a0a1db70df5f48 Filipe Manana 2020-12-14 2053 * groups before we were able to in the previous call to
a0a1db70df5f48 Filipe Manana 2020-12-14 2054 * btrfs_delete_unused_bgs()).
a0a1db70df5f48 Filipe Manana 2020-12-14 2055 */
a0a1db70df5f48 Filipe Manana 2020-12-14 2056 wait_on_bit(&fs_info->flags, BTRFS_FS_CLEANER_RUNNING,
a0a1db70df5f48 Filipe Manana 2020-12-14 2057 TASK_UNINTERRUPTIBLE);
a0a1db70df5f48 Filipe Manana 2020-12-14 2058
a8cc263eb58ca1 Filipe Manana 2020-12-14 2059 /*
a8cc263eb58ca1 Filipe Manana 2020-12-14 2060 * We've set the superblock to RO mode, so we might have made
a8cc263eb58ca1 Filipe Manana 2020-12-14 2061 * the cleaner task sleep without running all pending delayed
a8cc263eb58ca1 Filipe Manana 2020-12-14 2062 * iputs. Go through all the delayed iputs here, so that if an
a8cc263eb58ca1 Filipe Manana 2020-12-14 2063 * unmount happens without remounting RW we don't end up at
a8cc263eb58ca1 Filipe Manana 2020-12-14 2064 * finishing close_ctree() with a non-empty list of delayed
a8cc263eb58ca1 Filipe Manana 2020-12-14 2065 * iputs.
a8cc263eb58ca1 Filipe Manana 2020-12-14 2066 */
a8cc263eb58ca1 Filipe Manana 2020-12-14 2067 btrfs_run_delayed_iputs(fs_info);
a8cc263eb58ca1 Filipe Manana 2020-12-14 2068
8dabb7420f014a Stefan Behrens 2012-11-06 2069 btrfs_dev_replace_suspend_for_unmount(fs_info);
8dabb7420f014a Stefan Behrens 2012-11-06 2070 btrfs_scrub_cancel(fs_info);
061594ef171a5b Miao Xie 2013-05-15 2071 btrfs_pause_balance(fs_info);
8dabb7420f014a Stefan Behrens 2012-11-06 2072
cb13eea3b49055 Filipe Manana 2020-12-14 2073 /*
cb13eea3b49055 Filipe Manana 2020-12-14 2074 * Pause the qgroup rescan worker if it is running. We don't want
cb13eea3b49055 Filipe Manana 2020-12-14 2075 * it to be still running after we are in RO mode, as after that,
cb13eea3b49055 Filipe Manana 2020-12-14 2076 * by the time we unmount, it might have left a transaction open,
cb13eea3b49055 Filipe Manana 2020-12-14 2077 * so we would leak the transaction and/or crash.
cb13eea3b49055 Filipe Manana 2020-12-14 2078 */
cb13eea3b49055 Filipe Manana 2020-12-14 2079 btrfs_qgroup_wait_for_completion(fs_info, false);
cb13eea3b49055 Filipe Manana 2020-12-14 2080
6bccf3ab1e1f09 Jeff Mahoney 2016-06-21 2081 ret = btrfs_commit_super(fs_info);
49b25e0540904b Jeff Mahoney 2012-03-01 2082 if (ret)
49b25e0540904b Jeff Mahoney 2012-03-01 2083 goto restore;
c146afad2c7fea Yan Zheng 2008-11-12 2084 } else {
849615394515cc Josef Bacik 2021-10-05 2085 if (BTRFS_FS_ERROR(fs_info)) {
6ef3de9c9252b1 David Sterba 2013-09-13 2086 btrfs_err(fs_info,
efe120a067c867 Frank Holton 2013-12-20 2087 "Remounting read-write after error is not allowed");
6ef3de9c9252b1 David Sterba 2013-09-13 2088 ret = -EINVAL;
6ef3de9c9252b1 David Sterba 2013-09-13 2089 goto restore;
6ef3de9c9252b1 David Sterba 2013-09-13 2090 }
8a3db1849e9e25 Sergei Trofimovich 2012-04-16 2091 if (fs_info->fs_devices->rw_devices == 0) {
49b25e0540904b Jeff Mahoney 2012-03-01 2092 ret = -EACCES;
49b25e0540904b Jeff Mahoney 2012-03-01 2093 goto restore;
8a3db1849e9e25 Sergei Trofimovich 2012-04-16 2094 }
2b82032c34ec40 Yan Zheng 2008-11-17 2095
6528b99d3d2079 Anand Jain 2017-12-18 2096 if (!btrfs_check_rw_degradable(fs_info, NULL)) {
efe120a067c867 Frank Holton 2013-12-20 2097 btrfs_warn(fs_info,
52042d8e82ff50 Andrea Gelmini 2018-11-28 2098 "too many missing devices, writable remount is not allowed");
292fd7fc39aa06 Stefan Behrens 2012-10-30 2099 ret = -EACCES;
292fd7fc39aa06 Stefan Behrens 2012-10-30 2100 goto restore;
292fd7fc39aa06 Stefan Behrens 2012-10-30 2101 }
292fd7fc39aa06 Stefan Behrens 2012-10-30 2102
8a3db1849e9e25 Sergei Trofimovich 2012-04-16 2103 if (btrfs_super_log_root(fs_info->super_copy) != 0) {
10a3a3edc5b89a David Sterba 2020-02-05 2104 btrfs_warn(fs_info,
10a3a3edc5b89a David Sterba 2020-02-05 2105 "mount required to replay tree-log, cannot remount read-write");
49b25e0540904b Jeff Mahoney 2012-03-01 2106 ret = -EINVAL;
49b25e0540904b Jeff Mahoney 2012-03-01 2107 goto restore;
8a3db1849e9e25 Sergei Trofimovich 2012-04-16 2108 }
c146afad2c7fea Yan Zheng 2008-11-12 2109
44c0ca211a4da9 Boris Burkov 2020-11-18 2110 /*
44c0ca211a4da9 Boris Burkov 2020-11-18 2111 * NOTE: when remounting with a change that does writes, don't
44c0ca211a4da9 Boris Burkov 2020-11-18 2112 * put it anywhere above this point, as we are not sure to be
44c0ca211a4da9 Boris Burkov 2020-11-18 2113 * safe to write until we pass the above checks.
44c0ca211a4da9 Boris Burkov 2020-11-18 2114 */
44c0ca211a4da9 Boris Burkov 2020-11-18 2115 ret = btrfs_start_pre_rw_mount(fs_info);
2b6ba629b5aac5 Ilya Dryomov 2012-06-22 2116 if (ret)
2b6ba629b5aac5 Ilya Dryomov 2012-06-22 2117 goto restore;
2b6ba629b5aac5 Ilya Dryomov 2012-06-22 2118
a0a1db70df5f48 Filipe Manana 2020-12-14 2119 btrfs_clear_sb_rdonly(sb);
90c711ab380d63 Zygo Blaxell 2016-06-12 2120
afcdd129e05a92 Josef Bacik 2016-09-02 2121 set_bit(BTRFS_FS_OPEN, &fs_info->flags);
c146afad2c7fea Yan Zheng 2008-11-12 2122 }
dc81cdc58ad2f4 Miao Xie 2013-02-20 2123 out:
faa008899a4db2 Josef Bacik 2020-07-30 2124 /*
faa008899a4db2 Josef Bacik 2020-07-30 2125 * We need to set SB_I_VERSION here otherwise it'll get cleared by VFS,
faa008899a4db2 Josef Bacik 2020-07-30 2126 * since the absence of the flag means it can be toggled off by remount.
faa008899a4db2 Josef Bacik 2020-07-30 2127 */
faa008899a4db2 Josef Bacik 2020-07-30 2128 *flags |= SB_I_VERSION;
faa008899a4db2 Josef Bacik 2020-07-30 2129
2c6a92b0097464 Justin Maggard 2014-02-20 2130 wake_up_process(fs_info->transaction_kthread);
dc81cdc58ad2f4 Miao Xie 2013-02-20 2131 btrfs_remount_cleanup(fs_info, old_opts);
8cd2908846d11a Boris Burkov 2020-11-18 2132 btrfs_clear_oneshot_options(fs_info);
88c4703f00a9e8 Johannes Thumshirn 2020-07-23 2133 clear_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state);
88c4703f00a9e8 Johannes Thumshirn 2020-07-23 2134
c146afad2c7fea Yan Zheng 2008-11-12 2135 return 0;
49b25e0540904b Jeff Mahoney 2012-03-01 2136
49b25e0540904b Jeff Mahoney 2012-03-01 2137 restore:
1751e8a6cb935e Linus Torvalds 2017-11-27 2138 /* We've hit an error - don't reset SB_RDONLY */
bc98a42c1f7d0f David Howells 2017-07-17 2139 if (sb_rdonly(sb))
1751e8a6cb935e Linus Torvalds 2017-11-27 2140 old_flags |= SB_RDONLY;
a0a1db70df5f48 Filipe Manana 2020-12-14 2141 if (!(old_flags & SB_RDONLY))
a0a1db70df5f48 Filipe Manana 2020-12-14 2142 clear_bit(BTRFS_FS_STATE_RO, &fs_info->fs_state);
49b25e0540904b Jeff Mahoney 2012-03-01 2143 sb->s_flags = old_flags;
49b25e0540904b Jeff Mahoney 2012-03-01 2144 fs_info->mount_opt = old_opts;
49b25e0540904b Jeff Mahoney 2012-03-01 2145 fs_info->compress_type = old_compress_type;
49b25e0540904b Jeff Mahoney 2012-03-01 2146 fs_info->max_inline = old_max_inline;
0d2450abfa359f Sergei Trofimovich 2012-04-24 2147 btrfs_resize_thread_pool(fs_info,
0d2450abfa359f Sergei Trofimovich 2012-04-24 2148 old_thread_pool_size, fs_info->thread_pool_size);
49b25e0540904b Jeff Mahoney 2012-03-01 2149 fs_info->metadata_ratio = old_metadata_ratio;
dc81cdc58ad2f4 Miao Xie 2013-02-20 2150 btrfs_remount_cleanup(fs_info, old_opts);
88c4703f00a9e8 Johannes Thumshirn 2020-07-23 2151 clear_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state);
88c4703f00a9e8 Johannes Thumshirn 2020-07-23 2152
49b25e0540904b Jeff Mahoney 2012-03-01 2153 return ret;
c146afad2c7fea Yan Zheng 2008-11-12 2154 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-18 4:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-16 6:26 [PATCH] btrfs: prevent remounting to v1 space cache for subpage mount Qu Wenruo
2022-05-16 15:05 ` Josef Bacik
2022-05-17 0:27 ` Qu Wenruo
2022-05-18 4:58 ` [kbuild] " Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox