Skip to content

Commit d844152

Browse files
committed
Merge tag 'f2fs-for-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
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() ...
2 parents f66bc38 + 9883494 commit d844152

File tree

28 files changed

+2057
-1784
lines changed

28 files changed

+2057
-1784
lines changed

Documentation/ABI/testing/sysfs-fs-f2fs

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Description: Shows all enabled kernel features.
270270
inode_checksum, flexible_inline_xattr, quota_ino,
271271
inode_crtime, lost_found, verity, sb_checksum,
272272
casefold, readonly, compression, test_dummy_encryption_v2,
273-
atomic_write, pin_file, encrypted_casefold.
273+
atomic_write, pin_file, encrypted_casefold, linear_lookup.
274274

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

713-
=========================== ===========
713+
=========================== ==========
714714
Type_Name Type_Value
715-
=========================== ===========
716-
FAULT_KMALLOC 0x000000001
717-
FAULT_KVMALLOC 0x000000002
718-
FAULT_PAGE_ALLOC 0x000000004
719-
FAULT_PAGE_GET 0x000000008
720-
FAULT_ALLOC_BIO 0x000000010 (obsolete)
721-
FAULT_ALLOC_NID 0x000000020
722-
FAULT_ORPHAN 0x000000040
723-
FAULT_BLOCK 0x000000080
724-
FAULT_DIR_DEPTH 0x000000100
725-
FAULT_EVICT_INODE 0x000000200
726-
FAULT_TRUNCATE 0x000000400
727-
FAULT_READ_IO 0x000000800
728-
FAULT_CHECKPOINT 0x000001000
729-
FAULT_DISCARD 0x000002000
730-
FAULT_WRITE_IO 0x000004000
731-
FAULT_SLAB_ALLOC 0x000008000
732-
FAULT_DQUOT_INIT 0x000010000
733-
FAULT_LOCK_OP 0x000020000
734-
FAULT_BLKADDR_VALIDITY 0x000040000
735-
FAULT_BLKADDR_CONSISTENCE 0x000080000
736-
FAULT_NO_SEGMENT 0x000100000
737-
FAULT_INCONSISTENT_FOOTER 0x000200000
738-
=========================== ===========
715+
=========================== ==========
716+
FAULT_KMALLOC 0x00000001
717+
FAULT_KVMALLOC 0x00000002
718+
FAULT_PAGE_ALLOC 0x00000004
719+
FAULT_PAGE_GET 0x00000008
720+
FAULT_ALLOC_BIO 0x00000010 (obsolete)
721+
FAULT_ALLOC_NID 0x00000020
722+
FAULT_ORPHAN 0x00000040
723+
FAULT_BLOCK 0x00000080
724+
FAULT_DIR_DEPTH 0x00000100
725+
FAULT_EVICT_INODE 0x00000200
726+
FAULT_TRUNCATE 0x00000400
727+
FAULT_READ_IO 0x00000800
728+
FAULT_CHECKPOINT 0x00001000
729+
FAULT_DISCARD 0x00002000
730+
FAULT_WRITE_IO 0x00004000
731+
FAULT_SLAB_ALLOC 0x00008000
732+
FAULT_DQUOT_INIT 0x00010000
733+
FAULT_LOCK_OP 0x00020000
734+
FAULT_BLKADDR_VALIDITY 0x00040000
735+
FAULT_BLKADDR_CONSISTENCE 0x00080000
736+
FAULT_NO_SEGMENT 0x00100000
737+
FAULT_INCONSISTENT_FOOTER 0x00200000
738+
FAULT_TIMEOUT 0x00400000 (1000ms)
739+
FAULT_VMALLOC 0x00800000
740+
=========================== ==========
739741

740742
What: /sys/fs/f2fs/<disk>/discard_io_aware_gran
741743
Date: January 2023
@@ -846,3 +848,16 @@ Description: For several zoned storage devices, vendors will provide extra space
846848
reserved_blocks. However, it is not enough, since this extra space should
847849
not be shown to users. So, with this new sysfs node, we can hide the space
848850
by substracting reserved_blocks from total bytes.
851+
852+
What: /sys/fs/f2fs/<disk>/encoding_flags
853+
Date: April 2025
854+
Contact: "Chao Yu" <chao@kernel.org>
855+
Description: This is a read-only entry to show the value of sb.s_encoding_flags, the
856+
value is hexadecimal.
857+
858+
============================ ==========
859+
Flag_Name Flag_Value
860+
============================ ==========
861+
SB_ENC_STRICT_MODE_FL 0x00000001
862+
SB_ENC_NO_COMPAT_FALLBACK_FL 0x00000002
863+
============================ ==========

Documentation/filesystems/f2fs.rst

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,32 +182,34 @@ fault_type=%d Support configuring fault injection type, should be
182182
enabled with fault_injection option, fault type value
183183
is shown below, it supports single or combined type.
184184

185-
=========================== ===========
185+
=========================== ==========
186186
Type_Name Type_Value
187-
=========================== ===========
188-
FAULT_KMALLOC 0x000000001
189-
FAULT_KVMALLOC 0x000000002
190-
FAULT_PAGE_ALLOC 0x000000004
191-
FAULT_PAGE_GET 0x000000008
192-
FAULT_ALLOC_BIO 0x000000010 (obsolete)
193-
FAULT_ALLOC_NID 0x000000020
194-
FAULT_ORPHAN 0x000000040
195-
FAULT_BLOCK 0x000000080
196-
FAULT_DIR_DEPTH 0x000000100
197-
FAULT_EVICT_INODE 0x000000200
198-
FAULT_TRUNCATE 0x000000400
199-
FAULT_READ_IO 0x000000800
200-
FAULT_CHECKPOINT 0x000001000
201-
FAULT_DISCARD 0x000002000
202-
FAULT_WRITE_IO 0x000004000
203-
FAULT_SLAB_ALLOC 0x000008000
204-
FAULT_DQUOT_INIT 0x000010000
205-
FAULT_LOCK_OP 0x000020000
206-
FAULT_BLKADDR_VALIDITY 0x000040000
207-
FAULT_BLKADDR_CONSISTENCE 0x000080000
208-
FAULT_NO_SEGMENT 0x000100000
209-
FAULT_INCONSISTENT_FOOTER 0x000200000
210-
=========================== ===========
187+
=========================== ==========
188+
FAULT_KMALLOC 0x00000001
189+
FAULT_KVMALLOC 0x00000002
190+
FAULT_PAGE_ALLOC 0x00000004
191+
FAULT_PAGE_GET 0x00000008
192+
FAULT_ALLOC_BIO 0x00000010 (obsolete)
193+
FAULT_ALLOC_NID 0x00000020
194+
FAULT_ORPHAN 0x00000040
195+
FAULT_BLOCK 0x00000080
196+
FAULT_DIR_DEPTH 0x00000100
197+
FAULT_EVICT_INODE 0x00000200
198+
FAULT_TRUNCATE 0x00000400
199+
FAULT_READ_IO 0x00000800
200+
FAULT_CHECKPOINT 0x00001000
201+
FAULT_DISCARD 0x00002000
202+
FAULT_WRITE_IO 0x00004000
203+
FAULT_SLAB_ALLOC 0x00008000
204+
FAULT_DQUOT_INIT 0x00010000
205+
FAULT_LOCK_OP 0x00020000
206+
FAULT_BLKADDR_VALIDITY 0x00040000
207+
FAULT_BLKADDR_CONSISTENCE 0x00080000
208+
FAULT_NO_SEGMENT 0x00100000
209+
FAULT_INCONSISTENT_FOOTER 0x00200000
210+
FAULT_TIMEOUT 0x00400000 (1000ms)
211+
FAULT_VMALLOC 0x00800000
212+
=========================== ==========
211213
mode=%s Control block allocation mode which supports "adaptive"
212214
and "lfs". In "lfs" mode, there should be no random
213215
writes towards main area.

fs/f2fs/acl.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void *f2fs_acl_to_disk(struct f2fs_sb_info *sbi,
166166
}
167167

168168
static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
169-
struct page *dpage)
169+
struct folio *dfolio)
170170
{
171171
int name_index = F2FS_XATTR_INDEX_POSIX_ACL_DEFAULT;
172172
void *value = NULL;
@@ -176,13 +176,13 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
176176
if (type == ACL_TYPE_ACCESS)
177177
name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
178178

179-
retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage);
179+
retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dfolio);
180180
if (retval > 0) {
181181
value = f2fs_kmalloc(F2FS_I_SB(inode), retval, GFP_F2FS_ZERO);
182182
if (!value)
183183
return ERR_PTR(-ENOMEM);
184184
retval = f2fs_getxattr(inode, name_index, "", value,
185-
retval, dpage);
185+
retval, dfolio);
186186
}
187187

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

228228
static int __f2fs_set_acl(struct mnt_idmap *idmap,
229229
struct inode *inode, int type,
230-
struct posix_acl *acl, struct page *ipage)
230+
struct posix_acl *acl, struct folio *ifolio)
231231
{
232232
int name_index;
233233
void *value = NULL;
@@ -238,9 +238,8 @@ static int __f2fs_set_acl(struct mnt_idmap *idmap,
238238
switch (type) {
239239
case ACL_TYPE_ACCESS:
240240
name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
241-
if (acl && !ipage) {
242-
error = f2fs_acl_update_mode(idmap, inode,
243-
&mode, &acl);
241+
if (acl && !ifolio) {
242+
error = f2fs_acl_update_mode(idmap, inode, &mode, &acl);
244243
if (error)
245244
return error;
246245
set_acl_inode(inode, mode);
@@ -265,7 +264,7 @@ static int __f2fs_set_acl(struct mnt_idmap *idmap,
265264
}
266265
}
267266

268-
error = f2fs_setxattr(inode, name_index, "", value, size, ipage, 0);
267+
error = f2fs_setxattr(inode, name_index, "", value, size, ifolio, 0);
269268

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

361360
static int f2fs_acl_create(struct inode *dir, umode_t *mode,
362361
struct posix_acl **default_acl, struct posix_acl **acl,
363-
struct page *dpage)
362+
struct folio *dfolio)
364363
{
365364
struct posix_acl *p;
366365
struct posix_acl *clone;
@@ -372,7 +371,7 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
372371
if (S_ISLNK(*mode) || !IS_POSIXACL(dir))
373372
return 0;
374373

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

412-
int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
413-
struct page *dpage)
411+
int f2fs_init_acl(struct inode *inode, struct inode *dir, struct folio *ifolio,
412+
struct folio *dfolio)
414413
{
415414
struct posix_acl *default_acl = NULL, *acl = NULL;
416415
int error;
417416

418-
error = f2fs_acl_create(dir, &inode->i_mode, &default_acl, &acl, dpage);
417+
error = f2fs_acl_create(dir, &inode->i_mode, &default_acl, &acl, dfolio);
419418
if (error)
420419
return error;
421420

422421
f2fs_mark_inode_dirty_sync(inode, true);
423422

424423
if (default_acl) {
425-
error = __f2fs_set_acl(NULL, inode, ACL_TYPE_DEFAULT, default_acl,
426-
ipage);
424+
error = __f2fs_set_acl(NULL, inode, ACL_TYPE_DEFAULT,
425+
default_acl, ifolio);
427426
posix_acl_release(default_acl);
428427
} else {
429428
inode->i_default_acl = NULL;
430429
}
431430
if (acl) {
432431
if (!error)
433-
error = __f2fs_set_acl(NULL, inode, ACL_TYPE_ACCESS, acl,
434-
ipage);
432+
error = __f2fs_set_acl(NULL, inode, ACL_TYPE_ACCESS,
433+
acl, ifolio);
435434
posix_acl_release(acl);
436435
} else {
437436
inode->i_acl = NULL;

fs/f2fs/acl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ struct f2fs_acl_header {
3333

3434
#ifdef CONFIG_F2FS_FS_POSIX_ACL
3535

36-
extern struct posix_acl *f2fs_get_acl(struct inode *, int, bool);
37-
extern int f2fs_set_acl(struct mnt_idmap *, struct dentry *,
36+
struct posix_acl *f2fs_get_acl(struct inode *, int, bool);
37+
int f2fs_set_acl(struct mnt_idmap *, struct dentry *,
3838
struct posix_acl *, int);
39-
extern int f2fs_init_acl(struct inode *, struct inode *, struct page *,
40-
struct page *);
39+
int f2fs_init_acl(struct inode *, struct inode *, struct folio *ifolio,
40+
struct folio *dfolio);
4141
#else
4242
#define f2fs_get_acl NULL
4343
#define f2fs_set_acl NULL
4444

4545
static inline int f2fs_init_acl(struct inode *inode, struct inode *dir,
46-
struct page *ipage, struct page *dpage)
46+
struct folio *ifolio, struct folio *dfolio)
4747
{
4848
return 0;
4949
}

0 commit comments

Comments
 (0)