diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-20 08:11:30 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-20 08:11:30 -0700 | 
| commit | 46670259519f4ee4ab378dc014798aabe77c5057 (patch) | |
| tree | e257a04d15a594f35650bea780a242c79b5c56d1 /fs/btrfs/raid56.c | |
| parent | 2922800a1803f6319e329bdbfd2962fd83eb5360 (diff) | |
| parent | aa84ce8a78a1a5c10cdf9c7a5fb0c999fbc2c8d6 (diff) | |
Merge tag 'for-6.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba:
 "Stable fixes:
   - fix race between balance and cancel/pause
   - various iput() fixes
   - fix use-after-free of new block group that became unused
   - fix warning when putting transaction with qgroups enabled after
     abort
   - fix crash in subpage mode when page could be released between map
     and map read
   - when scrubbing raid56 verify the P/Q stripes unconditionally
   - fix minor memory leak in zoned mode when a block group with an
     unexpected superblock is found
  Regression fixes:
   - fix ordered extent split error handling when submitting direct IO
   - user irq-safe locking when adding delayed iputs"
* tag 'for-6.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: fix warning when putting transaction with qgroups enabled after abort
  btrfs: fix ordered extent split error handling in btrfs_dio_submit_io
  btrfs: set_page_extent_mapped after read_folio in btrfs_cont_expand
  btrfs: raid56: always verify the P/Q contents for scrub
  btrfs: use irq safe locking when running and adding delayed iputs
  btrfs: fix iput() on error pointer after error during orphan cleanup
  btrfs: fix double iput() on inode after an error during orphan cleanup
  btrfs: zoned: fix memory leak after finding block group with super blocks
  btrfs: fix use-after-free of new block group that became unused
  btrfs: be a bit more careful when setting mirror_num_ret in btrfs_map_block
  btrfs: fix race between balance and cancel/pause
Diffstat (limited to 'fs/btrfs/raid56.c')
| -rw-r--r-- | fs/btrfs/raid56.c | 11 | 
1 files changed, 3 insertions, 8 deletions
| diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index f37b925d587f..0249ea52bb80 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -71,7 +71,7 @@ static void rmw_rbio_work_locked(struct work_struct *work);  static void index_rbio_pages(struct btrfs_raid_bio *rbio);  static int alloc_rbio_pages(struct btrfs_raid_bio *rbio); -static int finish_parity_scrub(struct btrfs_raid_bio *rbio, int need_check); +static int finish_parity_scrub(struct btrfs_raid_bio *rbio);  static void scrub_rbio_work_locked(struct work_struct *work);  static void free_raid_bio_pointers(struct btrfs_raid_bio *rbio) @@ -2404,7 +2404,7 @@ static int alloc_rbio_essential_pages(struct btrfs_raid_bio *rbio)  	return 0;  } -static int finish_parity_scrub(struct btrfs_raid_bio *rbio, int need_check) +static int finish_parity_scrub(struct btrfs_raid_bio *rbio)  {  	struct btrfs_io_context *bioc = rbio->bioc;  	const u32 sectorsize = bioc->fs_info->sectorsize; @@ -2445,9 +2445,6 @@ static int finish_parity_scrub(struct btrfs_raid_bio *rbio, int need_check)  	 */  	clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags); -	if (!need_check) -		goto writeback; -  	p_sector.page = alloc_page(GFP_NOFS);  	if (!p_sector.page)  		return -ENOMEM; @@ -2516,7 +2513,6 @@ static int finish_parity_scrub(struct btrfs_raid_bio *rbio, int need_check)  		q_sector.page = NULL;  	} -writeback:  	/*  	 * time to start writing.  Make bios for everything from the  	 * higher layers (the bio_list in our rbio) and our p/q.  Ignore @@ -2699,7 +2695,6 @@ static int scrub_assemble_read_bios(struct btrfs_raid_bio *rbio)  static void scrub_rbio(struct btrfs_raid_bio *rbio)  { -	bool need_check = false;  	int sector_nr;  	int ret; @@ -2722,7 +2717,7 @@ static void scrub_rbio(struct btrfs_raid_bio *rbio)  	 * We have every sector properly prepared. Can finish the scrub  	 * and writeback the good content.  	 */ -	ret = finish_parity_scrub(rbio, need_check); +	ret = finish_parity_scrub(rbio);  	wait_event(rbio->io_wait, atomic_read(&rbio->stripes_pending) == 0);  	for (sector_nr = 0; sector_nr < rbio->stripe_nsectors; sector_nr++) {  		int found_errors; | 
