Messages in this thread |  | | Date | Thu, 9 Jul 2020 20:25:31 -0700 | From | Eric Biggers <> | Subject | Re: [f2fs-dev] [PATCH] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE |
| |
On Thu, Jul 09, 2020 at 08:20:35PM -0700, Jaegeuk Kim wrote: > On 07/10, Daeho Jeong wrote: > > 1. The valid data will be within i_size. > > 2. All the trim operations will be done in a unit of block, even if > > i_size is not aligned with BLKSIZE like the below. > > > > index = F2FS_BYTES_TO_BLK(range.start); > > pg_end = DIV_ROUND_UP(end_addr, F2FS_BLKSIZE); <= BLKSIZE aligned > > > > Are you worried about the case that sudden power-off occurs while a > > file is being truncated? > > ex) 1GB file is being truncated to 4KB -> sudden power-off -> > > i_size(4KB), i_blocks(maybe somewhere between 4KB and 1GB) > > Yes. Basically, I believe we can have some data beyond i_size like fsverity. >
Note that fs-verity files are read-only, and therefore this ioctl can't be used on them (since it requires a writable file descriptor). So that case doesn't need to be handled here.
- Eric
|  |