[PATCH v6 1/1] f2fs: dax: implement direct access

2017-07-12 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX

[PATCH v7 1/1] f2fs: dax: implement direct access

2017-07-17 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX

[PATCH v8 1/1] f2fs: dax: implement direct access

2017-07-20 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of

RE: [PATCH v8 1/1] f2fs: dax: implement direct access

2017-07-26 Thread sunqiuyang
_inode_flags() Thanks, From: Jaegeuk Kim [jaeg...@kernel.org] Sent: Wednesday, July 26, 2017 10:16 To: Dan Williams Cc: sunqiuyang; Linux Kernel Mailing List; linux-fsdevel; linux-f2fs-de...@lists.sourceforge.net; linux-nvd...@lists.01.org Subject: Re: [PATCH v8 1/1] f2fs: dax: impl

[PATCH 1/1] f2fs: merge equivalent flags F2FS_GET_BLOCK_[READ|DIO]

2017-08-09 Thread sunqiuyang
From: Qiuyang Sun Currently, the two flags F2FS_GET_BLOCK_[READ|DIO] are totally equivalent and can be used interchangably in all scenarios they are involved in. Neither of the flags is referenced in f2fs_map_blocks(), making them both the default case. To remove the

[PATCH 1/1] f2fs: merge equivalent flags F2FS_GET_BLOCK_[READ|DIO]

2017-08-08 Thread sunqiuyang
From: Qiuyang Sun Currently, the two flags F2FS_GET_BLOCK_[READ|DIO] are totally equivalent and can be used interchangably in all scenarios they are involved in. This patch deletes F2FS_GET_BLOCK_READ and uses F2FS_GET_BLOCK_DIO instead. Signed-off-by: Qiuyang Sun

[PATCH 2/3] f2fs:dax: Export interfaces: dax_map/unmap_atomic()

2017-05-03 Thread sunqiuyang
Export interfaces of dax_map/unmap_atomic() for usage in moving data pages of DAX files in garbage collection of F2FS. Signed-off-by: Qiuyang Sun --- fs/dax.c| 6 -- include/linux/dax.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH 3/3] f2fs:dax: Implement direct access

2017-05-03 Thread sunqiuyang
This patch implements Direct Access (DAX) in F2FS, including: - a mount option to enable DAX - read/write and mmap of regular files in the DAX way - zero-out of non-aligned partial blocks in the DAX way - garbage collection of DAX files - incompatibility of DAX with inline data, atomic or

[PATCH 1/3] f2fs:dax: fix races between page faults and fallocate

2017-05-03 Thread sunqiuyang
Currently in F2FS, page faults and fallocate operations, like punch_hole and collapse/insert/zero_range, are completely unsynchronized. This can result in page fault faulting in a page into a range that we are changing after truncating pagecache, and thus we can end up with a page mapped to

[PATCH v2 2/2] f2fs: dax: Implement direct access

2017-05-17 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX

[PATCH v2 1/2] f2fs: dax: fix races between page faults and truncating pages

2017-05-17 Thread sunqiuyang
From: Qiuyang Sun Currently in F2FS, page faults and operations that truncate the pagecahe or data blocks, are completely unsynchronized. This can result in page fault faulting in a page into a range that we are changing after truncating, and thus we can end up with a page

[PATCH v2 1/2] f2fs: dax: fix races between page faults and truncating pages

2017-05-17 Thread sunqiuyang
From: Qiuyang Sun Currently in F2FS, page faults and operations that truncate the pagecahe or data blocks, are completely unsynchronized. This can result in page fault faulting in a page into a range that we are changing after truncating, and thus we can end up with a page

[PATCH v5 1/1] f2fs: dax: implement direct access

2017-06-27 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX

[PATCH v3] f2fs: dax: implement direct access

2017-06-07 Thread sunqiuyang
From: Qiuyang Sun This is a new version of PATCH v2 2/2 with the following minor changes: - In dax_move_data_page(), the call of allocate_data_block() is changed according to the new definition of this function in f2fs-dev, and the usage of wio_mutex is removed; -

[PATCH v4 1/1] f2fs: dax: implement direct access

2017-06-15 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS. Signed-off-by: Qiuyang Sun --- Changelog v3 -> v4: In f2fs_iomap_begin(): - For the write branch, if f2fs_map_blocks() returns error (probably due to ENOSPC), the allocated

[PATCH 1/1] ext4: remove redundant assignment in ext4_iomap_begin()

2017-11-27 Thread sunqiuyang
From: Qiuyang Sun This line will not change the value of map.m_lblk in any case. Signed-off-by: Qiuyang Sun --- fs/ext4/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9f836e2..d4a42b1 100644 ---

[PATCH RFC 1/1] f2fs: add per-device superblocks

2017-11-08 Thread sunqiuyang
From: Qiuyang Sun Currently, a multi-device F2FS only has superblocks written in its start device, but not the others. Thus, we cannot tell if a single device is part of a F2FS by reading itself only, which may be unsafe in scenarios like transferring devices between

[PATCH 1/1] f2fs: release locks before return in f2fs_ioc_gc_range()

2018-03-13 Thread sunqiuyang
From: Qiuyang Sun Currently, we will leave the kernel with locks still held when the gc_range is invalid. This patch fixes the bug. Signed-off-by: Qiuyang Sun --- fs/f2fs/file.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 1/1] f2fs: release locks before return in f2fs_ioc_gc_range()

2018-03-13 Thread sunqiuyang
From: Qiuyang Sun Currently, we will leave the kernel with locks still held when the gc_range is invalid. This patch fixes the bug. Signed-off-by: Qiuyang Sun --- fs/f2fs/file.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

[PATCH RFC 1/1] f2fs: add per-device superblocks

2017-11-08 Thread sunqiuyang
From: Qiuyang Sun Currently, a multi-device F2FS only has superblocks written in its start device, but not the others. Thus, we cannot tell if a single device is part of a F2FS by reading itself only, which may be unsafe in scenarios like transferring devices between computer systems. This patch

[PATCH 1/1] f2fs: merge equivalent flags F2FS_GET_BLOCK_[READ|DIO]

2017-08-08 Thread sunqiuyang
From: Qiuyang Sun Currently, the two flags F2FS_GET_BLOCK_[READ|DIO] are totally equivalent and can be used interchangably in all scenarios they are involved in. This patch deletes F2FS_GET_BLOCK_READ and uses F2FS_GET_BLOCK_DIO instead. Signed-off-by: Qiuyang Sun --- fs/f2fs/data.c | 2 +-

[PATCH 1/1] f2fs: merge equivalent flags F2FS_GET_BLOCK_[READ|DIO]

2017-08-09 Thread sunqiuyang
From: Qiuyang Sun Currently, the two flags F2FS_GET_BLOCK_[READ|DIO] are totally equivalent and can be used interchangably in all scenarios they are involved in. Neither of the flags is referenced in f2fs_map_blocks(), making them both the default case. To remove the ambiguity, this patch

RE: [PATCH v8 1/1] f2fs: dax: implement direct access

2017-07-26 Thread sunqiuyang
_inode_flags() Thanks, From: Jaegeuk Kim [jaeg...@kernel.org] Sent: Wednesday, July 26, 2017 10:16 To: Dan Williams Cc: sunqiuyang; Linux Kernel Mailing List; linux-fsdevel; linux-f2fs-de...@lists.sourceforge.net; linux-nvd...@lists.01.org Subject: Re: [PATCH v8 1/1] f2fs: dax: impl

[PATCH v5 1/1] f2fs: dax: implement direct access

2017-06-27 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX files, by mapping both

[PATCH v6 1/1] f2fs: dax: implement direct access

2017-07-12 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX files, by mapping both

[PATCH v7 1/1] f2fs: dax: implement direct access

2017-07-17 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX files, by mapping both

[PATCH v8 1/1] f2fs: dax: implement direct access

2017-07-20 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX files, by mapping

[PATCH 1/1] ext4: remove redundant assignment in ext4_iomap_begin()

2017-11-27 Thread sunqiuyang
From: Qiuyang Sun This line will not change the value of map.m_lblk in any case. Signed-off-by: Qiuyang Sun --- fs/ext4/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9f836e2..d4a42b1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@

[PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-03 Thread sunqiuyang
From: Qiuyang Sun Currently, after a page is migrated, it 1) has its PG_isolated flag cleared in move_to_new_page(), and 2) is deleted from its LRU list (cc->migratepages) in unmap_and_move(). However, between steps 1) and 2), the page could be isolated by another thread in

RE: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-03 Thread sunqiuyang
T_POISON1. So we will end up with a bug like "list_del corruption. prev->next should be ffbf0a1eb8e0, but was dead0100" (see __list_del_entry_valid). From: Michal Hocko [mho...@kernel.org] Sent: Tuesday, September 03, 2019 21:17 To:

RE: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-04 Thread sunqiuyang
through this path? From: Michal Hocko [mho...@kernel.org] Sent: Wednesday, September 04, 2019 14:38 To: sunqiuyang Cc: linux-kernel@vger.kernel.org; linux...@kvack.org Subject: Re: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages On Wed 04-09-19 02:18:38,

RE: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-04 Thread sunqiuyang
From: Michal Hocko [mho...@kernel.org] Sent: Wednesday, September 04, 2019 16:14 To: sunqiuyang Cc: linux-kernel@vger.kernel.org; linux...@kvack.org Subject: Re: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages Do

[PATCH 1/1] f2fs: update multi-dev metadata in resize_fs

2019-09-18 Thread sunqiuyang
From: Qiuyang Sun Multi-device metadata should be updated in resize_fs as well. Also, we check that the new FS size still reaches the last device. Signed-off-by: Qiuyang Sun --- fs/f2fs/gc.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git

[PATCH v3 1/1] f2fs: ioctl for removing a range from F2FS

2019-05-20 Thread sunqiuyang
From: Qiuyang Sun This ioctl shrinks a given length (aligned to sections) from end of the main area. Any cursegs and valid blocks will be moved out before invalidating the range. This feature can be used for adjusting partition sizes online. Changlog v1 ==> v2: Sahitya Tummala: - Add this

RE: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-04 Thread sunqiuyang
From: Michal Hocko [mho...@kernel.org] Sent: Wednesday, September 04, 2019 20:52 To: sunqiuyang Cc: linux-kernel@vger.kernel.org; linux...@kvack.org Subject: Re: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages On Wed 04

[PATCH] f2fs: fix block address for __check_sit_bitmap

2018-12-18 Thread sunqiuyang
From: Qiuyang Sun Should use lstart (logical start address) instead of start (in dev) here. This fixes a bug in multi-device scenarios. Signed-off-by: Qiuyang Sun --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c

[RFC PATCH 1/1] f2fs-dev: ioctl for removing a range from F2FS

2019-02-20 Thread sunqiuyang
From: Qiuyang Sun This ioctl shrinks a given length (aligned to sections) from end of the main area. Any cursegs and valid blocks will be moved out before invalidating the range. This feature can be used for adjusting partition sizes online. Signed-off-by: Qiuyang Sun --- fs/f2fs/f2fs.h|

[PATCH v3 1/2] f2fs-dev: support multi-device direct IO

2019-01-06 Thread sunqiuyang
From: Qiuyang Sun Changelog v1 ==> v2: 1. Modify the definition of update_device_state(), and call it in direct write; 2. Move some local variables into branches where they are used. Changelog v2 ==> v3: Rename update_device_state() to f2fs_update_device_state() like other exported function

[PATCH 2/2] fs: support direct IO in a multi-device FS

2019-01-02 Thread sunqiuyang
From: Qiuyang Sun Don't use the bdev pointer in struct buffer_head for dio_bio_alloc(), since it may have been changed to another device in the FS in get_more_blocks(). Signed-off-by: Qiuyang Sun --- fs/direct-io.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-)

[PATCH 1/2] f2fs-dev: support multi-device direct IO

2019-01-02 Thread sunqiuyang
From: Qiuyang Sun The physical blocks in struct f2fs_map_blocks must be in the same device. Signed-off-by: Qiuyang Sun --- fs/f2fs/data.c | 20 +++- fs/f2fs/f2fs.h | 2 -- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index

[PATCH v2 1/2] f2fs-dev: support multi-device direct IO

2019-01-04 Thread sunqiuyang
From: Qiuyang Sun Changelog v1 ==> v2: 1. Modify the definition of update_device_state(), and call it in direct write; 2. Move some local variables into branches where they are used. Signed-off-by: Qiuyang Sun --- fs/f2fs/data.c| 25 - fs/f2fs/f2fs.h| 3 +--

[PATCH v2 1/2] f2fs: dax: fix races between page faults and truncating pages

2017-05-17 Thread sunqiuyang
From: Qiuyang Sun Currently in F2FS, page faults and operations that truncate the pagecahe or data blocks, are completely unsynchronized. This can result in page fault faulting in a page into a range that we are changing after truncating, and thus we can end up with a page mapped to disk blocks

[PATCH v2 1/2] f2fs: dax: fix races between page faults and truncating pages

2017-05-17 Thread sunqiuyang
From: Qiuyang Sun Currently in F2FS, page faults and operations that truncate the pagecahe or data blocks, are completely unsynchronized. This can result in page fault faulting in a page into a range that we are changing after truncating, and thus we can end up with a page mapped to disk blocks

[PATCH v2 2/2] f2fs: dax: Implement direct access

2017-05-17 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS, including: - a mount option to choose whether to enable DAX or not - read/write and mmap of regular files in the DAX way - zero-out of unaligned partial blocks in the DAX way - garbage collection of DAX files, by mapping both

[PATCH 1/3] f2fs:dax: fix races between page faults and fallocate

2017-05-03 Thread sunqiuyang
Currently in F2FS, page faults and fallocate operations, like punch_hole and collapse/insert/zero_range, are completely unsynchronized. This can result in page fault faulting in a page into a range that we are changing after truncating pagecache, and thus we can end up with a page mapped to

[PATCH 2/3] f2fs:dax: Export interfaces: dax_map/unmap_atomic()

2017-05-03 Thread sunqiuyang
Export interfaces of dax_map/unmap_atomic() for usage in moving data pages of DAX files in garbage collection of F2FS. Signed-off-by: Qiuyang Sun --- fs/dax.c| 6 -- include/linux/dax.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c

[PATCH 3/3] f2fs:dax: Implement direct access

2017-05-03 Thread sunqiuyang
This patch implements Direct Access (DAX) in F2FS, including: - a mount option to enable DAX - read/write and mmap of regular files in the DAX way - zero-out of non-aligned partial blocks in the DAX way - garbage collection of DAX files - incompatibility of DAX with inline data, atomic or

[PATCH v4 1/1] f2fs: dax: implement direct access

2017-06-15 Thread sunqiuyang
From: Qiuyang Sun This patch implements Direct Access (DAX) in F2FS. Signed-off-by: Qiuyang Sun --- Changelog v3 -> v4: In f2fs_iomap_begin(): - For the write branch, if f2fs_map_blocks() returns error (probably due to ENOSPC), the allocated blocks beyond original_i_size are truncated.

[PATCH v3] f2fs: dax: implement direct access

2017-06-07 Thread sunqiuyang
From: Qiuyang Sun This is a new version of PATCH v2 2/2 with the following minor changes: - In dax_move_data_page(), the call of allocate_data_block() is changed according to the new definition of this function in f2fs-dev, and the usage of wio_mutex is removed; - put_dax() is added in