Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE

2020-11-09 Thread Chao Yu
On 2020/11/10 2:12, Eric Biggers wrote: On Mon, Nov 09, 2020 at 10:29:25AM +0800, Chao Yu wrote: Oh I see, the cp-related checks are at the beginning of f2fs_ioctl() too. In that case a much better approach would be to add __f2fs_ioctl() which is called by f2fs_ioctl() and f2fs_compat_ioctl(),

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE

2020-11-09 Thread Eric Biggers
On Mon, Nov 09, 2020 at 10:29:25AM +0800, Chao Yu wrote: > > Oh I see, the cp-related checks are at the beginning of f2fs_ioctl() too. > > > > In that case a much better approach would be to add __f2fs_ioctl() which is > > called by f2fs_ioctl() and f2fs_compat_ioctl(), and have f2fs_ioctl() and >

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE

2020-11-08 Thread Chao Yu
On 2020/11/8 1:16, Eric Biggers wrote: On Sat, Nov 07, 2020 at 05:25:23PM +0800, Chao Yu wrote: On 2020/11/7 2:03, Eric Biggers wrote: On Fri, Nov 06, 2020 at 02:53:31PM +0800, Chao Yu wrote: +#if defined(__KERNEL__) +struct compat_f2fs_gc_range { + u32 sync; + compat_u64 start; +

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE

2020-11-07 Thread Eric Biggers
On Sat, Nov 07, 2020 at 05:25:23PM +0800, Chao Yu wrote: > On 2020/11/7 2:03, Eric Biggers wrote: > > On Fri, Nov 06, 2020 at 02:53:31PM +0800, Chao Yu wrote: > > > +#if defined(__KERNEL__) > > > +struct compat_f2fs_gc_range { > > > + u32 sync; > > > + compat_u64 start; > > > + compat_u64 len; > >

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE

2020-11-07 Thread Chao Yu
On 2020/11/7 2:03, Eric Biggers wrote: On Fri, Nov 06, 2020 at 02:53:31PM +0800, Chao Yu wrote: +#if defined(__KERNEL__) +struct compat_f2fs_gc_range { + u32 sync; + compat_u64 start; + compat_u64 len; +}; There's no need to use '#if defined(__KERNEL__)' in kernel source file

Re: [f2fs-dev] [PATCH v4 2/2] f2fs: fix compat F2FS_IOC_{MOVE, GARBAGE_COLLECT}_RANGE

2020-11-06 Thread Eric Biggers
On Fri, Nov 06, 2020 at 02:53:31PM +0800, Chao Yu wrote: > +#if defined(__KERNEL__) > +struct compat_f2fs_gc_range { > + u32 sync; > + compat_u64 start; > + compat_u64 len; > +}; There's no need to use '#if defined(__KERNEL__)' in kernel source files. Likewise for compat_f2fs_move_ran