ryding
2015-Sep-10 01:53 UTC
[Ocfs2-devel] [PATCH] ocfs2: Fill-in the unused portion of the block with zeros by dio_zero_block()
Hi Yiwen, I'm working on this issue. The patch will be send out soon. And the issue that do not support file hole will be fixed too. I have proved it can pass all ltp-aiodio test cases, and has better performance. ;-) Thanks, Ryan On 09/09/2015 09:55 AM, jiangyiwen wrote:> A simplified test case is (this case from Ryan): > 1) dd if=/dev/zero of=/mnt/hello bs=512 count=1 oflag=direct; > 2) truncate /mnt/hello -s 2097152 > file 'hello' is not exist before test. After this command, > file 'hello' should be all zero. But 512~4096 is some random data. > > Setting bh state to new when get a new block, if so, > direct_io_worker()->dio_zero_block() will fill-in the unused portion > of the block with zero. > > Signed-off-by: Yiwen Jiang <jiangyiwen at huawei.com> > --- > fs/ocfs2/aops.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c > index 1a35c61..bd106b9 100644 > --- a/fs/ocfs2/aops.c > +++ b/fs/ocfs2/aops.c > @@ -581,6 +581,7 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, > ret = -EIO; > goto bail; > } > + set_buffer_new(bh_result); > } > > /*
Andrew Morton
2015-Sep-14 22:22 UTC
[Ocfs2-devel] [PATCH] ocfs2: Fill-in the unused portion of the block with zeros by dio_zero_block()
On Thu, 10 Sep 2015 09:53:11 +0800 ryding <ryan.ding at oracle.com> wrote:> Hi Yiwen, > > I'm working on this issue. The patch will be send out soon. And the > issue that do not support file hole will be fixed too. I have proved it > can pass all ltp-aiodio test cases, and has better performance. ;-)Yes, your "ocfs2: fill in the unused portion of the block with zeros by dio_zero_block()" conflicts with this patch a little. Does your patchset need alteration to fix this bug?