[Ocfs2-devel] [PATCH] ocfs2: direct write will call ocfs2_rw_unlock() twice when doing aio+dio

2015-08-24 Thread Ryan Ding
Orabug: 21612107 Use wrong return value in ocfs2_file_write_iter(). This will cause ocfs2_rw_unlock() be called both in write_iter end_io, and trigger a BUG_ON. This issue exist since commit 7da839c475894ea872ec909a5d2e83dddccff5be. Signed-off-by: Ryan Ding ryan.d...@oracle.com --- fs/ocfs2

[Ocfs2-devel] [PATCH] ocfs2: direct write will call ocfs2_rw_unlock() twice when doing aio+dio

2015-08-24 Thread Ryan Ding
Orabug: 21612107 Use wrong return value in ocfs2_file_write_iter(). This will cause ocfs2_rw_unlock() be called both in write_iter end_io, and trigger a BUG_ON. This issue exist since commit 7da839c475894ea872ec909a5d2e83dddccff5be. Signed-off-by: Ryan Ding ryan.d...@oracle.com --- fs/ocfs2

Re: [Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-08-04 Thread Ryan Ding
Hi Joseph, On 08/04/2015 05:03 PM, Joseph Qi wrote: Hi Ryan, On 2015/8/4 14:16, Ryan Ding wrote: Hi Joseph, Sorry for bothering you with the old patches. But I really need to know what this patch is for. https://oss.oracle.com/pipermail/ocfs2-devel/2015-January/010496.html From

Re: [Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-08-05 Thread Ryan Ding
On 08/05/2015 02:40 PM, Joseph Qi wrote: On 2015/8/5 12:40, Ryan Ding wrote: Hi Joseph, On 08/04/2015 05:03 PM, Joseph Qi wrote: Hi Ryan, On 2015/8/4 14:16, Ryan Ding wrote: Hi Joseph, Sorry for bothering you with the old patches. But I really need to know what this patch

Re: [Ocfs2-devel] [PATCH 0/9 v6] ocfs2: support append O_DIRECT write

2015-08-05 Thread Ryan Ding
HiJoseph, On 08/05/2015 07:18 PM, Joseph Qi wrote: On 2015/8/5 16:07, Ryan Ding wrote: On 08/05/2015 02:40 PM, Joseph Qi wrote: On 2015/8/5 12:40, Ryan Ding wrote: Hi Joseph, On 08/04/2015 05:03 PM, Joseph Qi wrote: Hi Ryan, On 2015/8/4 14:16, Ryan Ding wrote: Hi Joseph, Sorry

Re: [Ocfs2-devel] [PATCH 0/8] ocfs2: fix ocfs2 direct io code patch to support sparse file and data ordering semantics

2015-10-07 Thread Ryan Ding
> 3) Do you have a test in case of lack of memory? I tested it in a system with 2GB memory. Is that enough? Thanks, Ryan > > On 2015/9/11 16:19, Ryan Ding wrote: >> The idea is to use buffer io(more precisely use the interface >> ocfs2_write_begin_nolock & ocfs2_write_end_nolo

Re: [Ocfs2-devel] [PATCH 0/8] ocfs2: fix ocfs2 direct io code patch to support sparse file and data ordering semantics

2015-10-08 Thread Ryan Ding
Hi Joseph, On 10/08/2015 02:13 PM, Joseph Qi wrote: > Hi Ryan, > > On 2015/10/8 11:12, Ryan Ding wrote: >> Hi Joseph, >> >> On 09/28/2015 06:20 PM, Joseph Qi wrote: >>> Hi Ryan, >>> I have gone through this patch set and done a simple performance te

[Ocfs2-devel] [PATCH 8/8] ocfs2: code clean up for direct io

2015-09-11 Thread Ryan Ding
when append dio: we will get the inode_lock in ocfs2_dio_get_block, there is no need to fall back to buffer io to ensure the coherence semantics. Now the drop dio procedure is gone. :) Signed-off-by: Ryan Ding <ryan.d...@oracle.com> Reviewed-by: Junxiao Bi <junxiao...@oracle.com> cc: J

[Ocfs2-devel] [PATCH 0/8] ocfs2: fix ocfs2 direct io code patch to support sparse file and data ordering semantics

2015-09-11 Thread Ryan Ding
rite. And we will also archive a better performance: eg. dd direct write new file with block size 4KB: before this patch: 2.5 MB/s after this patch: 66.4 MB/s ---- Ryan Ding (8): ocfs2: add ocfs2_write_type_t type to identify the ca

[Ocfs2-devel] [PATCH 3/8] ocfs2: test target page before change it

2015-09-11 Thread Ryan Ding
page a time. So the target_index is not sufficient to describe the actual data. change it to a range start at target_index, end in end_index. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> Reviewed-by: Junxiao Bi <junxiao...@oracle.com> cc: Joseph Qi <joseph...@huawei.com> ---

[Ocfs2-devel] [PATCH 7/8] ocfs2: fix sparse file & data ordering issue in direct io.

2015-09-11 Thread Ryan Ding
t/test.img bs=256K count=16384 oflag=direct 16384+0 records in 16384+0 records out 4294967296 bytes (4.3 GB) copied, 34.7611 s, 124 MB/s Signed-off-by: Ryan Ding <ryan.d...@oracle.com> Reviewed-by: Junxiao Bi <junxiao...@oracle.com> cc: Joseph Qi <joseph...@huawei.com>

[Ocfs2-devel] [PATCH 4/8] ocfs2: do not change i_size in write_end for direct io

2015-09-11 Thread Ryan Ding
tion in write_begin for direct io. And when there is no extents alloc, no meta data changes needed for direct io (since write_begin start trans for 2 reason: alloc extents & change i_size. Now none of them needed). So we can skip start trans procedure. Signed-off-by: Ryan Ding <ryan.d...@oracle.co

[Ocfs2-devel] [PATCH 5/8] ocfs2: return the physical address in ocfs2_write_cluster

2015-09-11 Thread Ryan Ding
ieve it to the direct io procedure. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> Reviewed-by: Junxiao Bi <junxiao...@oracle.com> cc: Joseph Qi <joseph...@huawei.com> --- fs/ocfs2/aops.c | 28 +--- 1 files changed, 13 insertions(+), 15 deletions(-) diff -

[Ocfs2-devel] [PATCH 1/8] ocfs2: add ocfs2_write_type_t type to identify the caller of write

2015-09-11 Thread Ryan Ding
To support direct io in ocfs2_write_begin_nolock & ocfs2_write_end_nolock. Remove unused args filp & flags. Add new arg type. The type is one of buffer/direct/mmap. Indicate 3 way to perform write. buffer/mmap type has implemented. direct type will be implemented later. Signed-off-by: R

[Ocfs2-devel] [PATCH 6/8] ocfs2: record UNWRITTEN extents when populate write desc

2015-09-11 Thread Ryan Ding
rite(it will be recorded in the 'ip_unwritten_list' member of inode info), and prevent the later direct write writing to the same cluster to do the zero work again. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> Reviewed-by: Junxiao Bi <junxiao...@oracle.com> cc: Joseph Qi <joseph...@huawei.com>

[Ocfs2-devel] [PATCH 2/8] ocfs2: use c_new to indicate newly allocated extents

2015-09-11 Thread Ryan Ding
ated or not. And use 'c_new' to specify a newly allocated extent. So the direct io procedure can use c_clear_unwritten to control the UNWRITTEN bit on extent. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> Reviewed-by: Junxiao Bi <junxiao...@oracle.com> cc: Joseph Qi <joseph...@huawei.com>

Re: [Ocfs2-devel] ocfs2: do not change i_size in write_end for direct io

2015-09-22 Thread Ryan Ding
HiDan, On 09/22/2015 12:24 AM, Dan Carpenter wrote: > Hello Ryan Ding, > > This is a semi-automatic email about new static checker warnings. > > The patch 3d598f72dc44: "ocfs2: do not change i_size in write_end for > direct io" from Sep 17, 2015, leads to the follow

Re: [Ocfs2-devel] [PATCH 0/8] ocfs2: fix ocfs2 direct io code patch to support sparse file and data ordering semantics

2015-12-10 Thread Ryan Ding
Hi Joseph, Thanks for your comments, please see my reply: On 12/10/2015 03:54 PM, Joseph Qi wrote: > Hi Ryan, > > On 2015/10/12 14:34, Ryan Ding wrote: >> Hi Joseph, >> >> On 10/08/2015 02:13 PM, Joseph Qi wrote: >>> Hi Ryan, >>> >>&g

[Ocfs2-devel] [PATCH] ocfs2: call ocfs2_abort when journal abort

2015-12-17 Thread Ryan Ding
we can not release lock resource in this state, other node will hung when it require a lock owned by this node. So panic and remaster is a reasonable choise. ocfs2_abort() will do all the above work. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> --- fs/ocfs2/journal.c

Re: [Ocfs2-devel] [PATCH 0/8] ocfs2: fix ocfs2 direct io code patch to support sparse file and data ordering semantics

2015-12-15 Thread Ryan Ding
Hi Joseph, On 12/14/2015 06:36 PM, Joseph Qi wrote: > Hi Ryan, > > On 2015/12/14 13:31, Ryan Ding wrote: >> Hi Joseph, >> >> On 12/10/2015 06:36 PM, Joseph Qi wrote: >>> Hi Ryan, >>> >>> On 2015/12/10 16:48, Ryan Ding wrote: >>>>

Re: [Ocfs2-devel] [PATCH 0/8] ocfs2: fix ocfs2 direct io code patch to support sparse file and data ordering semantics

2015-12-15 Thread Ryan Ding
Hi Joseph, On 12/16/2015 10:26 AM, Joseph Qi wrote: > On 2015/12/16 9:39, Ryan Ding wrote: >> Hi Joseph, >> >> On 12/14/2015 06:36 PM, Joseph Qi wrote: >>> Hi Ryan, >>> >>> On 2015/12/14 13:31, Ryan Ding wrote: >>>> Hi Joseph, >

[Ocfs2-devel] [PATCH V2] ocfs2: call ocfs2_abort when journal abort

2015-12-20 Thread Ryan Ding
we can not release lock resource in this state, other node will hung when it require a lock owned by this node. So panic and remaster is a reasonable choise. ocfs2_abort() will do all the above work. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> --- fs/ocfs2/journal.c

Re: [Ocfs2-devel] ocfs2 cannot continue when JBD2 has aborted the journal,

2015-12-17 Thread Ryan Ding
Hi Guanghui, I think I encounter an problem just like you. But it's not race case. Every time ocfs2_commit_threadreceive an errorfrom jbd2_journal_flush (which may cause by disk io error), it will continue to try commit journal. But in this case, journal should run into abort state, so retry

[Ocfs2-devel] [PATCH 4/4] ocfs2: Fix a deadlock issue in ocfs2_dio_end_io_write()

2015-11-20 Thread Ryan Ding
le & data ordering issue in direct io.") Signed-off-by: Ryan Ding <ryan.d...@oracle.com> --- fs/ocfs2/aops.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index f33cfe4..182f754 100644 --- a/fs/ocfs2/aops

[Ocfs2-devel] [PATCH 1/4] ocfs2: fix ip_unaligned_aio deadlock with dio work queue

2015-11-20 Thread Ryan Ding
hange it to a sync io instead. Just like ip_unaligned_aio lock, serialize the unaligned aio dio. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> --- fs/ocfs2/aops.c |6 -- fs/ocfs2/aops.h |7 --- fs/ocfs2/file.c | 27 +-- fs/ocfs2/inode.h |3 ---

[Ocfs2-devel] [PATCH 2/4] ocfs2: take ip_alloc_sem in ocfs2_dio_get_block & ocfs2_dio_end_io_write

2015-11-20 Thread Ryan Ding
Take ip_alloc_sem to prevent concurrent access to extent tree, which may cause the extent tree in an unstable state. Signed-off-by: Ryan Ding <ryan.d...@oracle.com> --- fs/ocfs2/aops.c | 23 +-- 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/ocfs2/

[Ocfs2-devel] [PATCH 3/4] ocfs2: fix disk file size and memory file size mismatch

2015-11-20 Thread Ryan Ding
are about to change file size. Fixes: af1310367f41 ("ocfs2: fix sparse file & data ordering issue in direct io.") Signed-off-by: Ryan Ding <ryan.d...@oracle.com> --- fs/ocfs2/aops.c | 27 +-- 1 files changed, 17 insertions(+), 10 deletions(-) d

Re: [Ocfs2-devel] [PATCH 1/4] ocfs2: fix ip_unaligned_aio deadlock with dio work queue

2015-11-23 Thread Ryan Ding
Hi Andrew, On 11/24/2015 08:26 AM, Andrew Morton wrote: > On Fri, 20 Nov 2015 16:23:16 +0800 Ryan Ding <ryan.d...@oracle.com> wrote: > >> In the current implementation of unaligned aio+dio, lock order behave as >> follow: >> >> in user process context: >