All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] f2fs: fix not to drop mount options when retrying fill_super
@ 2015-01-27 23:31 Jaegeuk Kim
  2015-01-27 23:31 ` [PATCH 2/5] f2fs: support norecovery mount option Jaegeuk Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: Jaegeuk Kim @ 2015-01-27 23:31 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

If wrong mount option was requested, f2fs tries to fill_super again.
But, during the next trial, f2fs has no valid mount options, since
parse_options deleted all the separators in the original string.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/super.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 5706c17..fbc7f5a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -950,6 +950,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	struct inode *root;
 	long err = -EINVAL;
 	bool retry = true;
+	char *options = NULL;
 	int i;
 
 try_onemore:
@@ -981,9 +982,15 @@ try_onemore:
 	set_opt(sbi, POSIX_ACL);
 #endif
 	/* parse mount options */
-	err = parse_options(sb, (char *)data);
-	if (err)
+	options = kstrdup((const char *)data, GFP_KERNEL);
+	if (data && !options) {
+		err = -ENOMEM;
 		goto free_sb_buf;
+	}
+
+	err = parse_options(sb, options);
+	if (err)
+		goto free_options;
 
 	sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize));
 	sb->s_max_links = F2FS_LINK_MAX;
@@ -1027,7 +1034,7 @@ try_onemore:
 	if (IS_ERR(sbi->meta_inode)) {
 		f2fs_msg(sb, KERN_ERR, "Failed to read F2FS meta data inode");
 		err = PTR_ERR(sbi->meta_inode);
-		goto free_sb_buf;
+		goto free_options;
 	}
 
 	err = get_valid_checkpoint(sbi);
@@ -1176,6 +1183,8 @@ free_cp:
 free_meta_inode:
 	make_bad_inode(sbi->meta_inode);
 	iput(sbi->meta_inode);
+free_options:
+	kfree(options);
 free_sb_buf:
 	brelse(raw_super_buf);
 free_sbi:
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2015-02-09  7:04 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 23:31 [PATCH 1/5] f2fs: fix not to drop mount options when retrying fill_super Jaegeuk Kim
2015-01-27 23:31 ` [PATCH 2/5] f2fs: support norecovery mount option Jaegeuk Kim
2015-01-29 11:52   ` Chao Yu
2015-01-29 18:27     ` Jaegeuk Kim
2015-01-29 18:31       ` [f2fs-dev] [PATCH 2/5 v2] " Jaegeuk Kim
2015-01-30  5:11         ` Chao Yu
2015-01-30  5:10       ` [PATCH 2/5] " Chao Yu
2015-01-27 23:31 ` [PATCH 3/5] f2fs: avoid write_checkpoint if f2fs is mounted readonly Jaegeuk Kim
2015-01-27 23:31   ` Jaegeuk Kim
2015-01-29 11:55   ` Chao Yu
2015-01-27 23:31 ` [PATCH 4/5] f2fs: should fail mount when trying to recover data on read-only dev Jaegeuk Kim
2015-01-27 23:31   ` Jaegeuk Kim
2015-01-29 12:16   ` Chao Yu
2015-01-29 21:39     ` Jaegeuk Kim
2015-01-30  5:12       ` Chao Yu
2015-01-30  5:15   ` Chao Yu
2015-01-27 23:31 ` [PATCH 5/5] f2fs: introduce a batched trim Jaegeuk Kim
2015-01-27 23:31   ` Jaegeuk Kim
2015-01-29 12:38   ` Chao Yu
2015-01-29 21:41     ` Jaegeuk Kim
2015-01-30  5:13       ` Chao Yu
2015-02-02 23:29         ` [PATCH 5/5 v2] " Jaegeuk Kim
2015-02-03  2:48           ` [f2fs-dev] " Changman Lee
2015-02-03 20:10             ` [f2fs-dev] [PATCH 5/5 v3] " Jaegeuk Kim
2015-02-05  9:30               ` Chao Yu
2015-02-06  6:18                 ` [f2fs-dev] [PATCH 5/5 v4] " Jaegeuk Kim
2015-02-06  8:20                   ` Chao Yu
2015-02-07 15:57                   ` Leon Romanovsky
2015-02-09  7:04                     ` Jaegeuk Kim
2015-01-29 11:24 ` [PATCH 1/5] f2fs: fix not to drop mount options when retrying fill_super Chao Yu
2015-01-29 11:24   ` Chao Yu
2015-01-29 18:21   ` [PATCH 1/5 v2] " Jaegeuk Kim
2015-01-30  5:02     ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.