Commit d8441523 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull f2fs updates from Jaegeuk Kim:
 "In this round, Matthew converted most of page operations to using
  folio. Beyond the work, we've applied some performance tunings such as
  GC and linear lookup, in addition to enhancing fault injection and
  sanity checks.

  Enhancements:
   - large number of folio conversions
   - add a control to turn on/off the linear lookup for performance
   - tune GC logics for zoned block device
   - improve fault injection and sanity checks

  Bug fixes:
   - handle error cases of memory donation
   - fix to correct check conditions in f2fs_cross_rename
   - fix to skip f2fs_balance_fs() if checkpoint is disabled
   - don't over-report free space or inodes in statvfs
   - prevent the current section from being selected as a victim during GC
   - fix to calculate first_zoned_segno correctly
   - fix to avoid inconsistence between SIT and SSA for zoned block device

  As usual, there are several debugging patches and clean-ups as well"

* tag 'f2fs-for-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (195 commits)
  f2fs: fix to correct check conditions in f2fs_cross_rename
  f2fs: use d_inode(dentry) cleanup dentry->d_inode
  f2fs: fix to skip f2fs_balance_fs() if checkpoint is disabled
  f2fs: clean up to check bi_status w/ BLK_STS_OK
  f2fs: introduce is_{meta,node}_folio
  f2fs: add ckpt_valid_blocks to the section entry
  f2fs: add a method for calculating the remaining blocks in the current segment in LFS mode.
  f2fs: introduce FAULT_VMALLOC
  f2fs: use vmalloc instead of kvmalloc in .init_{,de}compress_ctx
  f2fs: add f2fs_bug_on() in f2fs_quota_read()
  f2fs: add f2fs_bug_on() to detect potential bug
  f2fs: remove unused sbi argument from checksum functions
  f2fs: fix 32-bits hexademical number in fault injection doc
  f2fs: don't over-report free space or inodes in statvfs
  f2fs: return bool from __write_node_folio
  f2fs: simplify return value handling in f2fs_fsync_node_pages
  f2fs: always unlock the page in f2fs_write_single_data_page
  f2fs: remove wbc->for_reclaim handling
  f2fs: return bool from __f2fs_write_meta_folio
  f2fs: fix to return correct error number in f2fs_sync_node_pages()
  ...
parents f66bc387 9883494c
Loading
Loading
Loading
Loading
+41 −26
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ Description: Shows all enabled kernel features.
		inode_checksum, flexible_inline_xattr, quota_ino,
		inode_crtime, lost_found, verity, sb_checksum,
		casefold, readonly, compression, test_dummy_encryption_v2,
		atomic_write, pin_file, encrypted_casefold.
		atomic_write, pin_file, encrypted_casefold, linear_lookup.

What:		/sys/fs/f2fs/<disk>/inject_rate
Date:		May 2016
@@ -710,32 +710,34 @@ Description: Support configuring fault injection type, should be
		enabled with fault_injection option, fault type value
		is shown below, it supports single or combined type.

		===========================      ===========
		===========================      ==========
		Type_Name                        Type_Value
		===========================      ===========
		FAULT_KMALLOC                    0x000000001
		FAULT_KVMALLOC                   0x000000002
		FAULT_PAGE_ALLOC                 0x000000004
		FAULT_PAGE_GET                   0x000000008
		FAULT_ALLOC_BIO                  0x000000010 (obsolete)
		FAULT_ALLOC_NID                  0x000000020
		FAULT_ORPHAN                     0x000000040
		FAULT_BLOCK                      0x000000080
		FAULT_DIR_DEPTH                  0x000000100
		FAULT_EVICT_INODE                0x000000200
		FAULT_TRUNCATE                   0x000000400
		FAULT_READ_IO                    0x000000800
		FAULT_CHECKPOINT                 0x000001000
		FAULT_DISCARD                    0x000002000
		FAULT_WRITE_IO                   0x000004000
		FAULT_SLAB_ALLOC                 0x000008000
		FAULT_DQUOT_INIT                 0x000010000
		FAULT_LOCK_OP                    0x000020000
		FAULT_BLKADDR_VALIDITY           0x000040000
		FAULT_BLKADDR_CONSISTENCE        0x000080000
		FAULT_NO_SEGMENT                 0x000100000
		FAULT_INCONSISTENT_FOOTER        0x000200000
		===========================      ===========
		===========================      ==========
		FAULT_KMALLOC                    0x00000001
		FAULT_KVMALLOC                   0x00000002
		FAULT_PAGE_ALLOC                 0x00000004
		FAULT_PAGE_GET                   0x00000008
		FAULT_ALLOC_BIO                  0x00000010 (obsolete)
		FAULT_ALLOC_NID                  0x00000020
		FAULT_ORPHAN                     0x00000040
		FAULT_BLOCK                      0x00000080
		FAULT_DIR_DEPTH                  0x00000100
		FAULT_EVICT_INODE                0x00000200
		FAULT_TRUNCATE                   0x00000400
		FAULT_READ_IO                    0x00000800
		FAULT_CHECKPOINT                 0x00001000
		FAULT_DISCARD                    0x00002000
		FAULT_WRITE_IO                   0x00004000
		FAULT_SLAB_ALLOC                 0x00008000
		FAULT_DQUOT_INIT                 0x00010000
		FAULT_LOCK_OP                    0x00020000
		FAULT_BLKADDR_VALIDITY           0x00040000
		FAULT_BLKADDR_CONSISTENCE        0x00080000
		FAULT_NO_SEGMENT                 0x00100000
		FAULT_INCONSISTENT_FOOTER        0x00200000
		FAULT_TIMEOUT                    0x00400000 (1000ms)
		FAULT_VMALLOC                    0x00800000
		===========================      ==========

What:		/sys/fs/f2fs/<disk>/discard_io_aware_gran
Date:		January 2023
@@ -846,3 +848,16 @@ Description: For several zoned storage devices, vendors will provide extra space
		reserved_blocks. However, it is not enough, since this extra space should
		not be shown to users. So, with this new sysfs node, we can hide the space
		by substracting reserved_blocks from total bytes.

What:		/sys/fs/f2fs/<disk>/encoding_flags
Date:		April 2025
Contact:	"Chao Yu" <chao@kernel.org>
Description:	This is a read-only entry to show the value of sb.s_encoding_flags, the
		value is hexadecimal.

		============================     ==========
		Flag_Name                        Flag_Value
		============================     ==========
		SB_ENC_STRICT_MODE_FL            0x00000001
		SB_ENC_NO_COMPAT_FALLBACK_FL     0x00000002
		============================     ==========
+27 −25
Original line number Diff line number Diff line
@@ -182,32 +182,34 @@ fault_type=%d Support configuring fault injection type, should be
			 enabled with fault_injection option, fault type value
			 is shown below, it supports single or combined type.

			 ===========================      ===========
			 ===========================      ==========
			 Type_Name                        Type_Value
			 ===========================      ===========
			 FAULT_KMALLOC                    0x000000001
			 FAULT_KVMALLOC                   0x000000002
			 FAULT_PAGE_ALLOC                 0x000000004
			 FAULT_PAGE_GET                   0x000000008
			 FAULT_ALLOC_BIO                  0x000000010 (obsolete)
			 FAULT_ALLOC_NID                  0x000000020
			 FAULT_ORPHAN                     0x000000040
			 FAULT_BLOCK                      0x000000080
			 FAULT_DIR_DEPTH                  0x000000100
			 FAULT_EVICT_INODE                0x000000200
			 FAULT_TRUNCATE                   0x000000400
			 FAULT_READ_IO                    0x000000800
			 FAULT_CHECKPOINT                 0x000001000
			 FAULT_DISCARD                    0x000002000
			 FAULT_WRITE_IO                   0x000004000
			 FAULT_SLAB_ALLOC                 0x000008000
			 FAULT_DQUOT_INIT                 0x000010000
			 FAULT_LOCK_OP                    0x000020000
			 FAULT_BLKADDR_VALIDITY           0x000040000
			 FAULT_BLKADDR_CONSISTENCE        0x000080000
			 FAULT_NO_SEGMENT                 0x000100000
			 FAULT_INCONSISTENT_FOOTER        0x000200000
			 ===========================      ===========
			 ===========================      ==========
			 FAULT_KMALLOC                    0x00000001
			 FAULT_KVMALLOC                   0x00000002
			 FAULT_PAGE_ALLOC                 0x00000004
			 FAULT_PAGE_GET                   0x00000008
			 FAULT_ALLOC_BIO                  0x00000010 (obsolete)
			 FAULT_ALLOC_NID                  0x00000020
			 FAULT_ORPHAN                     0x00000040
			 FAULT_BLOCK                      0x00000080
			 FAULT_DIR_DEPTH                  0x00000100
			 FAULT_EVICT_INODE                0x00000200
			 FAULT_TRUNCATE                   0x00000400
			 FAULT_READ_IO                    0x00000800
			 FAULT_CHECKPOINT                 0x00001000
			 FAULT_DISCARD                    0x00002000
			 FAULT_WRITE_IO                   0x00004000
			 FAULT_SLAB_ALLOC                 0x00008000
			 FAULT_DQUOT_INIT                 0x00010000
			 FAULT_LOCK_OP                    0x00020000
			 FAULT_BLKADDR_VALIDITY           0x00040000
			 FAULT_BLKADDR_CONSISTENCE        0x00080000
			 FAULT_NO_SEGMENT                 0x00100000
			 FAULT_INCONSISTENT_FOOTER        0x00200000
			 FAULT_TIMEOUT                    0x00400000 (1000ms)
			 FAULT_VMALLOC                    0x00800000
			 ===========================      ==========
mode=%s			 Control block allocation mode which supports "adaptive"
			 and "lfs". In "lfs" mode, there should be no random
			 writes towards main area.
+16 −17
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static void *f2fs_acl_to_disk(struct f2fs_sb_info *sbi,
}

static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
						struct page *dpage)
						struct folio *dfolio)
{
	int name_index = F2FS_XATTR_INDEX_POSIX_ACL_DEFAULT;
	void *value = NULL;
@@ -176,13 +176,13 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
	if (type == ACL_TYPE_ACCESS)
		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;

	retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage);
	retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dfolio);
	if (retval > 0) {
		value = f2fs_kmalloc(F2FS_I_SB(inode), retval, GFP_F2FS_ZERO);
		if (!value)
			return ERR_PTR(-ENOMEM);
		retval = f2fs_getxattr(inode, name_index, "", value,
							retval, dpage);
							retval, dfolio);
	}

	if (retval > 0)
@@ -227,7 +227,7 @@ static int f2fs_acl_update_mode(struct mnt_idmap *idmap,

static int __f2fs_set_acl(struct mnt_idmap *idmap,
			struct inode *inode, int type,
			struct posix_acl *acl, struct page *ipage)
			struct posix_acl *acl, struct folio *ifolio)
{
	int name_index;
	void *value = NULL;
@@ -238,9 +238,8 @@ static int __f2fs_set_acl(struct mnt_idmap *idmap,
	switch (type) {
	case ACL_TYPE_ACCESS:
		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
		if (acl && !ipage) {
			error = f2fs_acl_update_mode(idmap, inode,
								&mode, &acl);
		if (acl && !ifolio) {
			error = f2fs_acl_update_mode(idmap, inode, &mode, &acl);
			if (error)
				return error;
			set_acl_inode(inode, mode);
@@ -265,7 +264,7 @@ static int __f2fs_set_acl(struct mnt_idmap *idmap,
		}
	}

	error = f2fs_setxattr(inode, name_index, "", value, size, ipage, 0);
	error = f2fs_setxattr(inode, name_index, "", value, size, ifolio, 0);

	kfree(value);
	if (!error)
@@ -360,7 +359,7 @@ static int f2fs_acl_create_masq(struct posix_acl *acl, umode_t *mode_p)

static int f2fs_acl_create(struct inode *dir, umode_t *mode,
		struct posix_acl **default_acl, struct posix_acl **acl,
		struct page *dpage)
		struct folio *dfolio)
{
	struct posix_acl *p;
	struct posix_acl *clone;
@@ -372,7 +371,7 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
	if (S_ISLNK(*mode) || !IS_POSIXACL(dir))
		return 0;

	p = __f2fs_get_acl(dir, ACL_TYPE_DEFAULT, dpage);
	p = __f2fs_get_acl(dir, ACL_TYPE_DEFAULT, dfolio);
	if (!p || p == ERR_PTR(-EOPNOTSUPP)) {
		*mode &= ~current_umask();
		return 0;
@@ -409,29 +408,29 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
	return ret;
}

int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
							struct page *dpage)
int f2fs_init_acl(struct inode *inode, struct inode *dir, struct folio *ifolio,
							struct folio *dfolio)
{
	struct posix_acl *default_acl = NULL, *acl = NULL;
	int error;

	error = f2fs_acl_create(dir, &inode->i_mode, &default_acl, &acl, dpage);
	error = f2fs_acl_create(dir, &inode->i_mode, &default_acl, &acl, dfolio);
	if (error)
		return error;

	f2fs_mark_inode_dirty_sync(inode, true);

	if (default_acl) {
		error = __f2fs_set_acl(NULL, inode, ACL_TYPE_DEFAULT, default_acl,
				       ipage);
		error = __f2fs_set_acl(NULL, inode, ACL_TYPE_DEFAULT,
				default_acl, ifolio);
		posix_acl_release(default_acl);
	} else {
		inode->i_default_acl = NULL;
	}
	if (acl) {
		if (!error)
			error = __f2fs_set_acl(NULL, inode, ACL_TYPE_ACCESS, acl,
					       ipage);
			error = __f2fs_set_acl(NULL, inode, ACL_TYPE_ACCESS,
					acl, ifolio);
		posix_acl_release(acl);
	} else {
		inode->i_acl = NULL;
+5 −5
Original line number Diff line number Diff line
@@ -33,17 +33,17 @@ struct f2fs_acl_header {

#ifdef CONFIG_F2FS_FS_POSIX_ACL

extern struct posix_acl *f2fs_get_acl(struct inode *, int, bool);
extern int f2fs_set_acl(struct mnt_idmap *, struct dentry *,
struct posix_acl *f2fs_get_acl(struct inode *, int, bool);
int f2fs_set_acl(struct mnt_idmap *, struct dentry *,
			struct posix_acl *, int);
extern int f2fs_init_acl(struct inode *, struct inode *, struct page *,
							struct page *);
int f2fs_init_acl(struct inode *, struct inode *, struct folio *ifolio,
		struct folio *dfolio);
#else
#define f2fs_get_acl	NULL
#define f2fs_set_acl	NULL

static inline int f2fs_init_acl(struct inode *inode, struct inode *dir,
				struct page *ipage, struct page *dpage)
				struct folio *ifolio, struct folio *dfolio)
{
	return 0;
}
+114 −128

File changed.

Preview size limit exceeded, changes collapsed.

Loading