From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Chao Yu <yuchao0@huawei.com>
Subject: [PATCH 2/2] f2fs: fix to restore old mount option in ->remount_fs
Date: Thu, 1 Mar 2018 23:40:32 +0800 [thread overview]
Message-ID: <20180301154032.6325-2-chao@kernel.org> (raw)
In-Reply-To: <20180301154032.6325-1-chao@kernel.org>
From: Chao Yu <yuchao0@huawei.com>
This patch fixes to restore old mount option once we encounter failure
in ->remount_fs.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
fs/f2fs/super.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index d8357ba19159..36c5e582c1f2 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1340,6 +1340,11 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE);
int old_whint_mode = sbi->whint_mode;
int old_alloc_mode = sbi->alloc_mode;
+ int old_inline_xattr_size = sbi->inline_xattr_size;
+ block_t old_root_reserved_blocks = sbi->root_reserved_blocks;
+ kuid_t old_resuid = sbi->s_resuid;
+ kgid_t old_resgid = sbi->s_resgid;
+ int old_write_io_size_bits = sbi->write_io_size_bits;
#ifdef CONFIG_F2FS_FAULT_INJECTION
struct f2fs_fault_info ffi = sbi->fault_info;
#endif
@@ -1489,6 +1494,11 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
sbi->s_qf_names[i] = s_qf_names[i];
}
#endif
+ sbi->write_io_size_bits = old_write_io_size_bits;
+ sbi->s_resgid = old_resgid;
+ sbi->s_resuid = old_resuid;
+ sbi->root_reserved_blocks = old_root_reserved_blocks;
+ sbi->inline_xattr_size = old_inline_xattr_size;
sbi->alloc_mode = old_alloc_mode;
sbi->whint_mode = old_whint_mode;
sbi->mount_opt = org_mount_opt;
--
2.14.1.145.gb3622a4ee
prev parent reply other threads:[~2018-03-01 15:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 15:40 [PATCH 1/2] f2fs: wrap sb_rdonly with f2fs_readonly Chao Yu
2018-03-01 15:40 ` Chao Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180301154032.6325-2-chao@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).