Re: Re: question about striped_read

2013-08-01 Thread majianpeng
On Thu, Aug 1, 2013 at 9:45 AM, majianpeng majianp...@gmail.com wrote: On Wed, Jul 31, 2013 at 3:32 PM, majianpeng majianp...@gmail.com wrote: [snip] Test case A: touch file dd if=file of=/dev/null bs=5M count=1 iflag=direct B: [data(2M)|hole(2m)][data(2M)] dd if=file of=/dev/null

Re: Re: question about striped_read

2013-08-01 Thread Yan, Zheng
On Thu, Aug 1, 2013 at 2:30 PM, majianpeng majianp...@gmail.com wrote: On Thu, Aug 1, 2013 at 9:45 AM, majianpeng majianp...@gmail.com wrote: On Wed, Jul 31, 2013 at 3:32 PM, majianpeng majianp...@gmail.com wrote: [snip] Test case A: touch file dd if=file of=/dev/null bs=5M count=1

Re: Re: question about striped_read

2013-07-31 Thread majianpeng
[snip] Test case A: touch file dd if=file of=/dev/null bs=5M count=1 iflag=direct B: [data(2M)|hole(2m)][data(2M)] dd if=file of=/dev/null bs=8M count=1 iflag=direct C: [data(4M)[hole(4M)][hole(4M)][data(2M)] dd if=file of=/dev/null bs=16M count=1 iflag=direct D: touch file;truncate -s

Re: Re: question about striped_read

2013-07-31 Thread Yan, Zheng
On Wed, Jul 31, 2013 at 3:32 PM, majianpeng majianp...@gmail.com wrote: [snip] Test case A: touch file dd if=file of=/dev/null bs=5M count=1 iflag=direct B: [data(2M)|hole(2m)][data(2M)] dd if=file of=/dev/null bs=8M count=1 iflag=direct C: [data(4M)[hole(4M)][hole(4M)][data(2M)]

Re: Re: question about striped_read

2013-07-31 Thread majianpeng
On Wed, Jul 31, 2013 at 3:32 PM, majianpeng majianp...@gmail.com wrote: [snip] Test case A: touch file dd if=file of=/dev/null bs=5M count=1 iflag=direct B: [data(2M)|hole(2m)][data(2M)] dd if=file of=/dev/null bs=8M count=1 iflag=direct C: [data(4M)[hole(4M)][hole(4M)][data(2M)]

Re: Re: question about striped_read

2013-07-31 Thread Yan, Zheng
On Thu, Aug 1, 2013 at 9:45 AM, majianpeng majianp...@gmail.com wrote: On Wed, Jul 31, 2013 at 3:32 PM, majianpeng majianp...@gmail.com wrote: [snip] Test case A: touch file dd if=file of=/dev/null bs=5M count=1 iflag=direct B: [data(2M)|hole(2m)][data(2M)] dd if=file of=/dev/null

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return. how about below patch. Hi Yan, i uesed this demo to test hole

Re: Re: question about striped_read

2013-07-30 Thread Yan, Zheng
On Tue, Jul 30, 2013 at 7:01 PM, majianpeng majianp...@gmail.com wrote: On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return.

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
On Tue, Jul 30, 2013 at 7:01 PM, majianpeng majianp...@gmail.com wrote: On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return.

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
On Tue, Jul 30, 2013 at 7:01 PM, majianpeng majianp...@gmail.com wrote: On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return.

Re: Re: question about striped_read

2013-07-30 Thread Yan, Zheng
On Tue, Jul 30, 2013 at 7:41 PM, majianpeng majianp...@gmail.com wrote: dd if=/dev/urandom bs=1M count=2 of=file_with_holes dd if=/dev/urandom bs=1M count=2 seek=4 of=file_with_holes conv=notrunc dd if=file_with_holes bs=8M /dev/null diff --git a/fs/ceph/file.c b/fs/ceph/file.c index

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
On Tue, Jul 30, 2013 at 7:41 PM, majianpeng majianp...@gmail.com wrote: dd if=/dev/urandom bs=1M count=2 of=file_with_holes dd if=/dev/urandom bs=1M count=2 seek=4 of=file_with_holes conv=notrunc dd if=file_with_holes bs=8M /dev/null diff --git a/fs/ceph/file.c b/fs/ceph/file.c index

Re: Re: question about striped_read

2013-07-30 Thread Sage Weil
On Wed, 31 Jul 2013, majianpeng wrote: On Tue, Jul 30, 2013 at 7:41 PM, majianpeng majianp...@gmail.com wrote: dd if=/dev/urandom bs=1M count=2 of=file_with_holes dd if=/dev/urandom bs=1M count=2 seek=4 of=file_with_holes conv=notrunc dd if=file_with_holes bs=8M /dev/null diff --git

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
On Wed, 31 Jul 2013, majianpeng wrote: On Tue, Jul 30, 2013 at 7:41 PM, majianpeng majianp...@gmail.com wrote: [snip] For ceph_osdc_readpages(), A: ret = ENOENT From the original code, for this case we should zero the area. Why? Thanks! Jianpeng Ma The object does not exist. B: ret = 0

Re: Re: question about striped_read

2013-07-30 Thread Sage Weil
On Wed, 31 Jul 2013, majianpeng wrote: On Wed, 31 Jul 2013, majianpeng wrote: On Tue, Jul 30, 2013 at 7:41 PM, majianpeng majianp...@gmail.com wrote: [snip] For ceph_osdc_readpages(), A: ret = ENOENT From the original code, for this case we should zero the area. Why? If an object

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
[snip] I think this patch can do work: Those case which i tested A: filesize=0, buffer=1M B: data[2M] | hole| data[2M], bs= 6M/7M C: data[4m] | hole | hole |data[2M] bs=16M/18M Are there some case ignore? Thanks! Jianpeng Ma diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 2ddf061..96ce893

Re: Re: question about striped_read

2013-07-30 Thread majianpeng
On Wed, Jul 31, 2013 at 9:36 AM, majianpeng majianp...@gmail.com wrote: [snip] I think this patch can do work: Those case which i tested A: filesize=0, buffer=1M B: data[2M] | hole| data[2M], bs= 6M/7M I don't think your zero buffer change is correct for this test case. dd if=/dev/urandom

Re: Re: question about striped_read

2013-07-29 Thread majianpeng
On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return. how about below patch. Hi Yan, i uesed this demo to test hole

Re: Re: question about striped_read

2013-07-29 Thread Yan, Zheng
On Tue, Jul 30, 2013 at 10:08 AM, majianpeng majianp...@gmail.com wrote: On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return.

Re: Re: question about striped_read

2013-07-28 Thread majianpeng
[snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return. how about below patch. Hi Yan, i uesed this demo to test hole case. dd if=/dev/urandom bs=4096 count=2 of=file_with_holes dd if=/dev/urandom

Re: Re: question about striped_read

2013-07-28 Thread Yan, Zheng
On Mon, Jul 29, 2013 at 11:00 AM, majianpeng majianp...@gmail.com wrote: [snip] I don't think the later was_short can handle the hole case. For the hole case, we should try reading next strip object instead of return. how about below patch. Hi Yan, i uesed this demo to test hole

Re: Re: question about striped_read

2013-07-25 Thread majianpeng
On Thu, 25 Jul 2013, majianpeng wrote: Hi all, I met a problem and ask somebody could help me. In func striped_read() if (ret 0) { int didpages = (page_align + ret) PAGE_CACHE_SHIFT; if (read pos - off) { dout( zero gap %llu

Re: Re: question about striped_read

2013-07-25 Thread Yan, Zheng
On Thu, Jul 25, 2013 at 2:55 PM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, majianpeng wrote: Hi all, I met a problem and ask somebody could help me. In func striped_read() if (ret 0) { int didpages = (page_align + ret) PAGE_CACHE_SHIFT;

Re: Re: question about striped_read

2013-07-25 Thread Sage Weil
On Thu, 25 Jul 2013, Yan, Zheng wrote: On Thu, Jul 25, 2013 at 2:55 PM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, majianpeng wrote: Hi all, I met a problem and ask somebody could help me. In func striped_read() if (ret 0) { int didpages =

Re: Re: question about striped_read

2013-07-25 Thread Yan, Zheng
On Fri, Jul 26, 2013 at 8:48 AM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, Yan, Zheng wrote: On Thu, Jul 25, 2013 at 2:55 PM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, majianpeng wrote: Hi all, I met a problem and ask somebody could help me. In func

Re: Re: question about striped_read

2013-07-25 Thread Yan, Zheng
On Fri, Jul 26, 2013 at 9:22 AM, majianpeng majianp...@gmail.com wrote: On Fri, Jul 26, 2013 at 8:48 AM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, Yan, Zheng wrote: On Thu, Jul 25, 2013 at 2:55 PM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, majianpeng wrote:

Re: Re: question about striped_read

2013-07-25 Thread majianpeng
On Fri, Jul 26, 2013 at 9:22 AM, majianpeng majianp...@gmail.com wrote: On Fri, Jul 26, 2013 at 8:48 AM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, Yan, Zheng wrote: On Thu, Jul 25, 2013 at 2:55 PM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, majianpeng wrote:

Re: Re: question about striped_read

2013-07-25 Thread Yan, Zheng
On Fri, Jul 26, 2013 at 9:38 AM, majianpeng majianp...@gmail.com wrote: On Fri, Jul 26, 2013 at 9:22 AM, majianpeng majianp...@gmail.com wrote: On Fri, Jul 26, 2013 at 8:48 AM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, Yan, Zheng wrote: On Thu, Jul 25, 2013 at 2:55 PM,

Re: Re: question about striped_read

2013-07-25 Thread majianpeng
On Fri, Jul 26, 2013 at 9:38 AM, majianpeng majianp...@gmail.com wrote: On Fri, Jul 26, 2013 at 9:22 AM, majianpeng majianp...@gmail.com wrote: On Fri, Jul 26, 2013 at 8:48 AM, majianpeng majianp...@gmail.com wrote: On Thu, 25 Jul 2013, Yan, Zheng wrote: On Thu, Jul 25, 2013 at 2:55 PM,

Re: question about striped_read

2013-07-24 Thread Sage Weil
On Thu, 25 Jul 2013, majianpeng wrote: Hi all, I met a problem and ask somebody could help me. In func striped_read() if (ret 0) { int didpages = (page_align + ret) PAGE_CACHE_SHIFT; if (read pos - off) { dout( zero gap %llu