[f2fs-dev] [PATCH 2/6] f2fs: reduce indentation in f2fs_file_write_iter()

2022-01-04 Thread Jaegeuk Kim
From: Eric Biggers Replace 'if (ret > 0)' with 'if (ret <= 0) goto out_unlock;'. No change in behavior. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 64 +++--- 1 file changed, 34 insertions(+), 30

[f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2022-01-04 Thread Jaegeuk Kim
From: Eric Biggers Implement 'struct iomap_ops' for f2fs, in preparation for making f2fs use iomap for direct I/O. Note that this may be used for other things besides direct I/O in the future; however, for now I've only tested it for direct I/O. Signed-off-by: Eric Biggers Signed-off-by: Jaege

[f2fs-dev] [PATCH 4/6] f2fs: fix the f2fs_file_write_iter tracepoint

2022-01-04 Thread Jaegeuk Kim
From: Eric Biggers Pass in the original position and count rather than the position and count that were updated by the write. Also use the correct types for all arguments, in particular the file offset which was being truncated to 32 bits on 32-bit platforms. Signed-off-by: Eric Biggers Review

[f2fs-dev] [PATCH 6/6] f2fs: use iomap for direct I/O

2022-01-04 Thread Jaegeuk Kim
From: Eric Biggers Make f2fs_file_read_iter() and f2fs_file_write_iter() use the iomap direct I/O implementation instead of the fs/direct-io.c one. The iomap implementation is more efficient, and it also avoids the need to add new features and optimizations to the old implementation. This new i

[f2fs-dev] [PATCH 1/6] f2fs: rework write preallocations

2022-01-04 Thread Jaegeuk Kim
From: Eric Biggers f2fs_write_begin() assumes that all blocks were preallocated by default unless FI_NO_PREALLOC is explicitly set. This invites data corruption, as there are cases in which not all blocks are preallocated. Commit 47501f87c61a ("f2fs: preallocate DIO blocks when forcing buffered_

[f2fs-dev] [PATCH 3/6] f2fs: do not expose unwritten blocks to user by DIO

2022-01-04 Thread Jaegeuk Kim
DIO preallocates physical blocks before writing data, but if an error occurrs or power-cut happens, we can see block contents from the disk. This patch tries to fix it by 1) turning to buffered writes for DIO into holes, 2) truncating unwritten blocks from error or power-cut. Signed-off-by: Jaegeu

Re: [f2fs-dev] [PATCH 5/6] f2fs: implement iomap operations

2022-01-04 Thread Jaegeuk Kim
On 12/30, Chao Yu wrote: > On 2021/12/3 5:28, Jaegeuk Kim wrote: > > On 12/02, Jaegeuk Kim wrote: > > > On 12/02, Eric Biggers wrote: > > > > On Thu, Dec 02, 2021 at 11:00:47AM -0800, Jaegeuk Kim wrote: > > > > > On 12/02, Jaegeuk Kim wrote: > > > > > > On 12/02, Eric Biggers wrote: > > > > > > > O

Re: [f2fs-dev] [PATCH] f2fs: quota: fix potential deadlock

2022-01-04 Thread Chao Yu
On 2022/1/4 23:17, Greg KH wrote: On Tue, Jan 04, 2022 at 11:05:36PM +0800, Chao Yu wrote: On 2022/1/4 21:18, Greg KH wrote: On Tue, Jan 04, 2022 at 09:05:13PM +0800, Chao Yu wrote: commit a5c0042200b28fff3bde6fa128ddeaef97990f8d upstream. As Yi Zhuang reported in bugzilla: https://bugzilla.

Re: [f2fs-dev] [PATCH] f2fs: quota: fix potential deadlock

2022-01-04 Thread Greg KH
On Tue, Jan 04, 2022 at 11:05:36PM +0800, Chao Yu wrote: > On 2022/1/4 21:18, Greg KH wrote: > > On Tue, Jan 04, 2022 at 09:05:13PM +0800, Chao Yu wrote: > > > commit a5c0042200b28fff3bde6fa128ddeaef97990f8d upstream. > > > > > > As Yi Zhuang reported in bugzilla: > > > > > > https://bugzilla.ker

Re: [f2fs-dev] [PATCH] f2fs: quota: fix potential deadlock

2022-01-04 Thread Chao Yu
On 2022/1/4 21:18, Greg KH wrote: On Tue, Jan 04, 2022 at 09:05:13PM +0800, Chao Yu wrote: commit a5c0042200b28fff3bde6fa128ddeaef97990f8d upstream. As Yi Zhuang reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214299 There is potential deadlock during quota data flush as bel

Re: [f2fs-dev] [PATCH] f2fs: quota: fix potential deadlock

2022-01-04 Thread Greg KH
On Tue, Jan 04, 2022 at 09:05:13PM +0800, Chao Yu wrote: > commit a5c0042200b28fff3bde6fa128ddeaef97990f8d upstream. > > As Yi Zhuang reported in bugzilla: > > https://bugzilla.kernel.org/show_bug.cgi?id=214299 > > There is potential deadlock during quota data flush as below: > > Thread A:

[f2fs-dev] [PATCH] f2fs: quota: fix potential deadlock

2022-01-04 Thread Chao Yu
commit a5c0042200b28fff3bde6fa128ddeaef97990f8d upstream. As Yi Zhuang reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214299 There is potential deadlock during quota data flush as below: Thread A: Thread B: f2fs_dquot_acquire down_read(&sbi->quota_sem)