Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Chao Yu
On 2020/8/28 13:46, Daeho Jeong wrote: From: Daeho Jeong After releasing cblocks, the compressed file can be accidentally disabled in compression mode, since it has zero cblocks. As we are using IMMUTABLE flag to present released cblocks state, we can add IMMUTABLE state check when considering

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
I think this patch is enough for now. If you have anything else we should take care, please let me know~ 2020년 8월 31일 (월) 오후 3:08, Chao Yu 님이 작성: > > On 2020/8/31 11:55, Daeho Jeong wrote: > >> - open(O_RDWR) > >> - ioctl(FS_IOC_SETFLAGS, F2FS_COMPR_FL) > >> - write() > >> - ioctl(RELEASE_COMPRESS

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Chao Yu
On 2020/8/31 11:55, Daeho Jeong wrote: - open(O_RDWR) - ioctl(FS_IOC_SETFLAGS, F2FS_COMPR_FL) - write() - ioctl(RELEASE_COMPRESS_BLOCKS) -- inode is immutable now - ioctl(FS_IOC_SETFLAGS, ~F2FS_COMPR_FL) -- Should we allow to update immutable inode? as we know, normally, immutable inode should d

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
> - open(O_RDWR) > - ioctl(FS_IOC_SETFLAGS, F2FS_COMPR_FL) > - write() > - ioctl(RELEASE_COMPRESS_BLOCKS) -- inode is immutable now > - ioctl(FS_IOC_SETFLAGS, ~F2FS_COMPR_FL) -- Should we allow to update > immutable inode? > as we know, normally, immutable inode should deny open(O_WRONLY or O_RDWR

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Chao Yu
On 2020/8/31 9:44, Daeho Jeong wrote: Sorry, I didn't get your point. So, do you think this patch is ok? And we need to consider that we need more immutable checks for other cases? Yes, this patch looks good to me. But, IMO, we should discuss about whether we need to add more immutable checks

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
Sorry, I didn't get your point. So, do you think this patch is ok? And we need to consider that we need more immutable checks for other cases? Or you want to remove this immutable check from here and add the check to each ioctl functions? 2020년 8월 31일 (월) 오전 10:24, Chao Yu 님이 작성: > > On 2020/8/31

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Chao Yu
On 2020/8/31 7:42, Daeho Jeong wrote: Do you have any reason not to put this check here? No, the place is okay to me. :) If we do this check outside of here, we definitely make a mistake sooner or later. I just want to see whether we can cover all cases in where we missed to add immutable c

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-30 Thread Daeho Jeong
Do you have any reason not to put this check here? If we do this check outside of here, we definitely make a mistake sooner or later. 2020년 8월 30일 (일) 오후 12:24, Chao Yu 님이 작성: > > On 2020-8-28 13:46, Daeho Jeong wrote: > > From: Daeho Jeong > > > > After releasing cblocks, the compressed file can

Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-29 Thread Chao Yu
On 2020-8-28 13:46, Daeho Jeong wrote: From: Daeho Jeong After releasing cblocks, the compressed file can be accidentally disabled in compression mode, since it has zero cblocks. As we are using IMMUTABLE flag to present released cblocks state, we can add IMMUTABLE state check when considering

[PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks

2020-08-27 Thread Daeho Jeong
From: Daeho Jeong After releasing cblocks, the compressed file can be accidentally disabled in compression mode, since it has zero cblocks. As we are using IMMUTABLE flag to present released cblocks state, we can add IMMUTABLE state check when considering the compressed file disabling. Signed-of