Patch "f2fs: Only lfs mode is allowed with zoned block device feature" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    f2fs: Only lfs mode is allowed with zoned block device feature

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     f2fs-only-lfs-mode-is-allowed-with-zoned-block-devic.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8091cf755d8ce0ee1d4f66b1b7e7e25afb8fd5fb
Author: Chunhai Guo <guochunhai@xxxxxxxx>
Date:   Thu Aug 3 22:28:42 2023 +0800

    f2fs: Only lfs mode is allowed with zoned block device feature
    
    [ Upstream commit 2bd4df8fcbc72f58ce3c62ed021ab291ca42de0b ]
    
    Now f2fs support four block allocation modes: lfs, adaptive,
    fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
    device feature.
    
    Fixes: 6691d940b0e0 ("f2fs: introduce fragment allocation mode mount option")
    Signed-off-by: Chunhai Guo <guochunhai@xxxxxxxx>
    Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 3d91b5313947f..72b7ea71f55df 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -860,11 +860,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
 			if (!name)
 				return -ENOMEM;
 			if (!strcmp(name, "adaptive")) {
-				if (f2fs_sb_has_blkzoned(sbi)) {
-					f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
-					kfree(name);
-					return -EINVAL;
-				}
 				F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
 			} else if (!strcmp(name, "lfs")) {
 				F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
@@ -1329,6 +1324,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
 			F2FS_OPTION(sbi).discard_unit =
 					DISCARD_UNIT_SECTION;
 		}
+
+		if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS) {
+			f2fs_info(sbi, "Only lfs mode is allowed with zoned block device feature");
+			return -EINVAL;
+		}
 #else
 		f2fs_err(sbi, "Zoned block device support is not enabled");
 		return -EINVAL;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux