]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'f2fs-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Mar 2024 18:26:00 +0000 (11:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 18 Mar 2024 18:26:00 +0000 (11:26 -0700)
Pull f2fs update from Jaegeuk Kim:
 "In this round, there are a number of updates on mainly two areas:
  Zoned block device support and Per-file compression. For example,
  we've found several issues to support Zoned block device especially
  having large sections regarding to GC and file pinning used for
  Android devices. In compression side, we've fixed many corner race
  conditions that had broken the design assumption.

  Enhancements:
   - Support file pinning for Zoned block device having large section
   - Enhance the data recovery after sudden power cut on Zoned block
     device
   - Add more error injection cases to easily detect the kernel panics
   - add a proc entry show the entire disk layout
   - Improve various error paths paniced by BUG_ON in block allocation
     and GC
   - support SEEK_DATA and SEEK_HOLE for compression files

  Bug fixes:
   - avoid use-after-free issue in f2fs_filemap_fault
   - fix some race conditions to break the atomic write design
     assumption
   - fix to truncate meta inode pages forcely
   - resolve various per-file compression issues wrt the space
     management and compression policies
   - fix some swap-related bugs

  In addition, we removed deprecated codes such as io_bits and
  heap_allocation, and also fixed minor error handling routines with
  neat debugging messages"

* tag 'f2fs-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (60 commits)
  f2fs: fix to avoid use-after-free issue in f2fs_filemap_fault
  f2fs: truncate page cache before clearing flags when aborting atomic write
  f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag
  f2fs: prevent atomic write on pinned file
  f2fs: fix to handle error paths of {new,change}_curseg()
  f2fs: unify the error handling of f2fs_is_valid_blkaddr
  f2fs: zone: fix to remove pow2 check condition for zoned block device
  f2fs: fix to truncate meta inode pages forcely
  f2fs: compress: fix reserve_cblocks counting error when out of space
  f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks
  f2fs: add a proc entry show disk layout
  f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup
  f2fs: fix to check return value of f2fs_gc_range
  f2fs: fix to check return value __allocate_new_segment
  f2fs: fix to do sanity check in update_sit_entry
  f2fs: fix to reset fields for unloaded curseg
  f2fs: clean up new_curseg()
  f2fs: relocate f2fs_precache_extents() in f2fs_swap_activate()
  f2fs: fix blkofs_end correctly in f2fs_migrate_blocks()
  f2fs: ro: don't start discard thread for readonly image
  ...

1  2 
fs/f2fs/f2fs.h
fs/f2fs/namei.c
fs/f2fs/segment.c
fs/f2fs/super.c

diff --cc fs/f2fs/f2fs.h
Simple merge
diff --cc fs/f2fs/namei.c
Simple merge
index e1065ba702076131067091fe173b19edab41b5d1,e9e8b9bb3ce9b6c0f7b4407a3749b235aed3f3a2..4fd76e867e0a2efa772fda10e9f01a870c2edcd2
@@@ -4916,13 -5021,11 +5028,13 @@@ static int check_zone_write_pointer(str
         * selected for write operation until it get discarded.
         */
        f2fs_notice(sbi, "Valid blocks are not aligned with write "
-                   "pointer: valid block[0x%x,0x%x] cond[0x%x]",
-                   zone_segno, valid_block_cnt, zone->cond);
+                   "pointer: valid block[0x%x,0x%x] cond[%s]",
+                   zone_segno, valid_block_cnt, f2fs_zone_status[zone->cond]);
  
 +      nofs_flags = memalloc_nofs_save();
        ret = blkdev_zone_mgmt(fdev->bdev, REQ_OP_ZONE_FINISH,
 -                              zone->start, zone->len, GFP_NOFS);
 +                              zone->start, zone->len);
 +      memalloc_nofs_restore(nofs_flags);
        if (ret == -EOPNOTSUPP) {
                ret = blkdev_issue_zeroout(fdev->bdev, zone->wp,
                                        zone->len - (zone->wp - zone->start),
diff --cc fs/f2fs/super.c
index f6ffbfe75653cf0de1741bf5094f4a6340faa659,03f56a7c80fa1b86af063dfa6652368efcd3d8f3..a6867f26f141836dcd4a4f0136dd67a9de6c3c74
@@@ -4265,9 -4201,9 +4201,9 @@@ static int f2fs_scan_devices(struct f2f
                        } else {
                                FDEV(i).start_blk = FDEV(i - 1).end_blk + 1;
                                FDEV(i).end_blk = FDEV(i).start_blk +
-                                       (FDEV(i).total_segments <<
-                                       sbi->log_blocks_per_seg) - 1;
+                                               SEGS_TO_BLKS(sbi,
+                                               FDEV(i).total_segments) - 1;
 -                              FDEV(i).bdev_handle = bdev_open_by_path(
 +                              FDEV(i).bdev_file = bdev_file_open_by_path(
                                        FDEV(i).path, mode, sbi->sb, NULL);
                        }
                }