[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250730015357epcms2p63d8a9d98265a526f959e33fa2d7c610b@epcms2p6>
Date: Wed, 30 Jul 2025 10:53:57 +0900
From: Daejun Park <daejun7.park@...sung.com>
To: Chao Yu <chao@...nel.org>, "jaegeuk@...nel.org" <jaegeuk@...nel.org>
CC: "linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Daejun Park <daejun7.park@...sung.com>
Subject: RE: [PATCH] f2fs: don't break allocation when crossing contiguous
sections
Hi Chao Yu,
> + lfs_dio_write = (flag == F2FS_GET_BLOCK_DIO && f2fs_lfs_mode(sbi) &&
> + map->m_may_create);
> +
Consider moving the lfs_dio_write assignment to just after the if (!map->m_may_create …) check
so it isn’t evaluated when creation isn’t allowed.
> @@ -4171,6 +4172,10 @@ static int f2fs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> map.m_next_pgofs = &next_pgofs;
> map.m_seg_type = f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
> inode->i_write_hint);
> + if (flags & IOMAP_WRITE && iomap->private) {
Since iomap->private is only set on the LFS DIO path, you can drop the flags & IOMAP_WRITE and
test the pointer directly.
> + map.m_last_pblk = (unsigned long)iomap->private;
> + iomap->private = NULL;
> + }
>
> /*
> * If the blocks being overwritten are already allocated,
> @@ -4209,6 +4214,9 @@ static int f2fs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> iomap->flags = IOMAP_F_MERGED;
> iomap->bdev = map.m_bdev;
> iomap->addr = F2FS_BLK_TO_BYTES(map.m_pblk);
> +
> + if (flags & IOMAP_WRITE && map.m_last_pblk)
> + iomap->private = (void *)map.m_last_pblk;
Likewise, checking only map.m_last_pblk is sufficient for restoring.
Reviewed-by: Daejun Park <daejun7.park@...sung.com>
Powered by blists - more mailing lists