Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Eric Biggers
On Fri, Jun 12, 2020 at 09:00:58AM +0900, Daeho Jeong wrote: > For the incremental way of erasing, we might as well support the > (offset, length) option in a unit of 4KiB. > > So, you might use this ioctl like the below. Does it work for you? > struct f2fs_sec_trim { > u64 startblk; >

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Daeho Jeong
For the incremental way of erasing, we might as well support the (offset, length) option in a unit of 4KiB. So, you might use this ioctl like the below. Does it work for you? struct f2fs_sec_trim { u64 startblk; u64 blklen; u32 flags; }; sectrim.startblk = 0; sectrim.blkle

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Eric Biggers
On Fri, Jun 12, 2020 at 07:49:12AM +0900, Daeho Jeong wrote: > 2020년 6월 12일 (금) 오전 1:27, Eric Biggers 님이 작성: > > > > On Thu, Jun 11, 2020 at 12:16:52PM +0900, Daeho Jeong wrote: > > > + for (index = pg_start; index < pg_end;) { > > > + struct dnode_of_data dn; > > > + un

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Daeho Jeong
2020년 6월 12일 (금) 오전 1:27, Eric Biggers 님이 작성: > > On Thu, Jun 11, 2020 at 12:16:52PM +0900, Daeho Jeong wrote: > > + for (index = pg_start; index < pg_end;) { > > + struct dnode_of_data dn; > > + unsigned int end_offset; > > + > > + set_new_dnode(&dn, inode,

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Eric Biggers
On Thu, Jun 11, 2020 at 12:16:52PM +0900, Daeho Jeong wrote: > + for (index = pg_start; index < pg_end;) { > + struct dnode_of_data dn; > + unsigned int end_offset; > + > + set_new_dnode(&dn, inode, NULL, NULL, 0); > + ret = f2fs_get_dnode_of_data

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Eric Biggers
On Thu, Jun 11, 2020 at 08:04:06PM +0900, Daeho Jeong wrote: > > > +static int f2fs_sec_trim_file(struct file *filp, unsigned long arg) > > > +{ > > > + struct inode *inode = file_inode(filp); > > > + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > > > + struct address_space *mapping = i

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Daeho Jeong
2020년 6월 11일 (목) 오후 5:56, Chao Yu 님이 작성: > > On 2020/6/11 11:16, Daeho Jeong wrote: > > From: Daeho Jeong > > > > Added a new ioctl to send discard commands or/and zero out > > to whole data area of a regular file for security reason. > > > > Signed-off-by: Daeho Jeong > > --- > > fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH v2] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-06-11 Thread Chao Yu
On 2020/6/11 11:16, Daeho Jeong wrote: > From: Daeho Jeong > > Added a new ioctl to send discard commands or/and zero out > to whole data area of a regular file for security reason. > > Signed-off-by: Daeho Jeong > --- > fs/f2fs/f2fs.h | 8 +++ > fs/f2fs/file.c | 143