[PATCH] mkcephfs: Don't transfer absolute path of mkcephfs to other hosts.

2013-11-05 Thread majianpeng
When exec 'mkcephfs -a -c ceph.conf',it will transfer absolute path of mkcephfs to other hosts.But for different hosts, the path of mkcephfs may different.It will make the command error.The error message is bash: ./mkcephfs: No such file or directory. So we should transfer the name mkcephfs to

[RESEND PATCH V7] ceph:Implement readv/preadv for sync operation

2013-09-26 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V7: Because commit 73a7075e3f6ec63dc remove the ki_left of struct iocb. So rewrite this patch. Test on v3.12-rc2, it looks good. V6: Fix some bugs; V5: -before getattr,it must put

Re: Re: [RESEND PATCH V7] ceph:Implement readv/preadv for sync operation

2013-09-26 Thread majianpeng
Signed-off-by: Yan, Zheng zheng.z@intel.com Thanks very much! Jianpeng Ma On 09/26/2013 02:42 PM, majianpeng wrote: For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V7: Because commit 73a7075e3f6ec63dc remove the ki_left

[RESEND PATCH V5] ceph:Implement readv/preadv for sync operation

2013-09-24 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V5: -before getattr,it must put caps which already holded avoid deadlock. -only do generic_segment_checks for sync-read avoid do again in func generic_file_aio_read V4: -modify one

Re: Re: [RESEND PATCH V5] ceph:Implement readv/preadv for sync operation

2013-09-24 Thread majianpeng
On 09/24/2013 04:54 PM, majianpeng wrote: On 09/24/2013 04:05 PM, majianpeng wrote: diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 3de8982..5422d8e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -408,51 +408,94 @@ more: * * If the read spans object boundary, just do multiple

Re: Re: [RESEND PATCH V5] ceph:Implement readv/preadv for sync operation

2013-09-24 Thread majianpeng
On 09/24/2013 04:05 PM, majianpeng wrote: diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 3de8982..5422d8e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -408,51 +408,94 @@ more: * * If the read spans object boundary, just do multiple reads. */ -static ssize_t ceph_sync_read

[RESEND PATCH V6] ceph:Implement readv/preadv for sync operation

2013-09-24 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V6: Fix some bugs; V5: -before getattr,it must put caps which already holded avoid deadlock. -only do generic_segment_checks for sync-read avoid do again in func

Re: Re: [RESEND PATCH V6] ceph:Implement readv/preadv for sync operation

2013-09-24 Thread majianpeng
On 09/25/2013 09:07 AM, majianpeng wrote: For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V6: Fix some bugs; V5: -before getattr,it must put caps which already holded avoid deadlock. -only do generic_segment_checks for sync

[PATCH] ceph: fix sync read eof check deadlock

2013-09-22 Thread majianpeng
As Yan,Zheng said, commit 0913444208db intruoduce a bug:getattr need to read lock inode's filelock. But the lock can be in unstable state. the getattr request waits for lock's state to become stable, the lock waits for client to release Fr cap. Commit 6a026589ba333185c466c90 resolved the same bug

Re: Re: [PATCH V4 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-21 Thread majianpeng
On Thu, Sep 12, 2013 at 1:25 PM, majianpeng majianp...@gmail.com wrote: For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V4: modify one bug. V3: modify some bug. V2: -add generic_segment_checks -using struct

[PATCH V4 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-11 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V4: modify one bug. V3: modify some bug. V2: -add generic_segment_checks -using struct iov_iter replace cloning the iovs. -return previous successfully copied if

[PATCH V4 2/2] ceph: Implement writev/pwritev for sync operation.

2013-09-11 Thread majianpeng
For writev/pwritev sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. I divided the write-sync-operation into two functions.One for direct-write,other for none-direct-sync-write.This is because for none-direct-sync-write we can merge iovs to one.But for

[RESEND PATCH V4 2/2] ceph: Implement writev/pwritev for sync operation.

2013-09-11 Thread majianpeng
For writev/pwritev sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. I divided the write-sync-operation into two functions.One for direct-write,other for none-direct-sync-write.This is because for none-direct-sync-write we can merge iovs to one.But for

Re: Re: [RESEND PATCH V4 2/2] ceph: Implement writev/pwritev for sync operation.

2013-09-11 Thread majianpeng
Reviewed-by: Yan, Zheng zheng.z@intel.com Thanks very much! Jianpeng Ma On 09/12/2013 01:54 PM, majianpeng wrote: For writev/pwritev sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. I divided the write-sync-operation into two functions.One

Re: Re: [PATCH V2 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-09 Thread majianpeng
On 09/09/2013 10:09 AM, majianpeng wrote: On 09/06/2013 04:48 PM, majianpeng wrote: For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V2: -add generic_segment_checks -using struct iov_iter replace cloning the iovs. -return

[PATCH V3 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-09 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V3: modify some bug. V2: -add generic_segment_checks -using struct iov_iter replace cloning the iovs. -return previous successfully copied if ceph_copy_page_vector_to_user met

[PATCH V3 2/2] ceph: Implement writev/pwritev for sync operation.

2013-09-09 Thread majianpeng
For writev/pwritev sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. I divided the write-sync-operation into two functions.One for direct-write,other for none-direct-sync-write.This is because for none-direct-sync-write we can merge iovs to one.But for

Re: Re: [PATCH V3 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-09 Thread majianpeng
On 09/10/2013 10:04 AM, majianpeng wrote: For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V3: modify some bug. V2: -add generic_segment_checks -using struct iov_iter replace cloning the iovs. -return previous

[PATCH V2 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-06 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. V2: -add generic_segment_checks -using struct iov_iter replace cloning the iovs. -return previous successfully copied if ceph_copy_page_vector_to_user met error. Signed-off-by:

Re: Re: [PATCH 2/2] ceph: Implement writev/pwritev for sync operation.

2013-09-05 Thread majianpeng
Hi, Thank you for the patch. On 09/03/2013 04:52 PM, majianpeng wrote: For writev/pwritev sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. I divided the write-sync-operation into two functions.One for direct-write,other for none-direct-sync-write.This

[PATCH 1/2] ceph: Implement readv/preadv for sync operation.

2013-09-03 Thread majianpeng
For readv/preadv sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 175 - 1 file changed, 123 insertions(+), 52 deletions(-) diff

[PATCH 2/2] ceph: Implement writev/pwritev for sync operation.

2013-09-03 Thread majianpeng
For writev/pwritev sync-operatoin, ceph only do the first iov. It don't think other iovs.Now implement this. I divided the write-sync-operation into two functions.One for direct-write,other for none-direct-sync-write.This is because for none-direct-sync-write we can merge iovs to one.But for

[PATCH] ceph: allow sync_read/write return partial successed size of read/write.

2013-08-21 Thread majianpeng
Hi Sage: This patch based on my previous patchceph: fix bugs about handling short-read for sync read mode. I can't see this patch in ceph-client#testing.Maybe you forget it ? Thanks! Jianpeng Ma For sync_read/write, it may do multi stripe operations.If one of those met erro, we return

[PATCH TRIVIVAL] ceph: Move the place for EOLDSNAPC handle in ceph_aio_write to easily understand

2013-08-08 Thread majianpeng
Only for ceph_sync_write, the osd can return EOLDSNAPC.so move the related codes after the call ceph_sync_write. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fs/ceph/file.c

Re: Re: [PATCH TRIVIVAL] ceph: Move the place for EOLDSNAPC handle in ceph_aio_write to easily understand

2013-08-08 Thread majianpeng
Looks good; I've applied this to the tree. Canyou review the below patch while we are looking at this code? Thanks! sage From 26d0d7b213d87db0ef46e885ae749c27395c11b1 Mon Sep 17 00:00:00 2001 From: Sage Weil s...@inktank.com Date: Thu, 8 Aug 2013 09:39:44 -0700 Subject: [PATCH] ceph: replace

Re: Re: [PATCH] ceph: Update FUSE_USE_VERSION from 26 to 30.

2013-08-05 Thread majianpeng
On Thu, 1 Aug 2013, majianpeng wrote: When compiling, it met this error: In file included from /usr/local/include/fuse/fuse.h:19:0, from client/fuse_ll.cc:17: /usr/local/include/fuse/fuse_common.h:474:4: error: #error only API version 30 or greater is supported Update

[PATCH] cephfs: Add a function which print pg name using cephfs.

2013-08-04 Thread majianpeng
As 'cephfs map' print, it can print pgs.So add this function. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- src/cephfs.cc | 9 + src/client/ioctl.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cephfs.cc b/src/cephfs.cc index f25d02a..aaa6ad4 100644

[PATCH 1/2] libceph: Add a new func ceph_calc_ceph_temp_pg and export it.

2013-08-04 Thread majianpeng
We need temp seed of pg in ceph filesystem.So we add a new func and export it. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- include/linux/ceph/osdmap.h | 2 ++ net/ceph/osdmap.c | 24 2 files changed, 26 insertions(+) diff --git

[PATCH 0/2] print pgname using cephfs.

2013-08-04 Thread majianpeng
Using 'cephfs show_location/map' to print pgname. Jianpeng Ma (2): libceph: Add a new func ceph_calc_ceph_temp_pg and export it. ceph: Add pg_name filed in struct ceph_ioctl_dataloc. fs/ceph/ioctl.c | 10 +- fs/ceph/ioctl.h | 1 + include/linux/ceph/osdmap.h

Re: Re: [PATCH 2/2] ceph: Add pg_name filed in struct ceph_ioctl_dataloc.

2013-08-04 Thread majianpeng
On Mon, 5 Aug 2013, majianpeng wrote: As the 'ceph help' print, it will print pgs.But now it can't. So we add this.There are two type name of pg, temp and stable. Because the command 'ceph pg dump' print temp name,so we also print the temp name of pg. Unfortunately we can't modify the ioctl

[PATCH] ceph: Add check returned value on func ceph_calc_ceph_pg.

2013-08-02 Thread majianpeng
Func ceph_calc_ceph_pg maybe failed.So add check for returned value. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/ioctl.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e0b4ef3..8c463dd 100644 ---

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-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 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

[PATCH] ceph: Update FUSE_USE_VERSION from 26 to 30.

2013-07-31 Thread majianpeng
When compiling, it met this error: In file included from /usr/local/include/fuse/fuse.h:19:0, from client/fuse_ll.cc:17: /usr/local/include/fuse/fuse_common.h:474:4: error: #error only API version 30 or greater is supported Update FUSE_USE_VERSION from 26 to 30. Signed-off-by:

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 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 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 2ddf061

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 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-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-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 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 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

[PATCH][TRIVIAL] ceph: Add comments for ENOENT which returned from osd.

2013-07-25 Thread majianpeng
The error ENOENT from osd has special meaning.It means the data of read-area are all-zero.In order to reduce the flow between client and osd, it used this method. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 5 + 1 file changed, 5 insertions(+) diff --git

[PATCH][TRIVIAL] ceph: Modify comments for checkeof.

2013-07-25 Thread majianpeng
If we met checkeof,it only for eof rather than hithole.So update the comments. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 2ddf061..d1b5f61 100644 ---

question about striped_read

2013-07-24 Thread majianpeng
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 to %llu\n, off + read, pos);

[PATCH 0/2] libceph: handle notarget requests.

2013-07-16 Thread majianpeng
In func ceph_osdc_start_request,there are two types: A:nofail which mean if met error, the request will retry to do. B:fail which mean if met error, the caller handle the error,like realse those relative pages. But now, the code don't distinguish between them. For caller which can met error, it

[PATCH 2/2] libceph: Remap notarget requests in handle_timeout.

2013-07-16 Thread majianpeng
If __map_request failed ,the request can't send and in list req_notarget. For those, they only remaped in func ceph_osdc_handle_map which update the epoch of osdmap.There are some reasons like ENOMEM which can't cause update epoch of osdmap.So the notarget requested can't remap for ever. Add a

[PATCH 1/2] libceph: For nofail == false, if __map_request failed,it should unregister.

2013-07-16 Thread majianpeng
For nofail == false request, if __map_request failed, the caller do cleanup work,like release the relative pages.It doesn't make any sense to retry this request.So only give up it. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- net/ceph/osd_client.c | 3 ++- 1 file changed, 2

[PATCH] ceph: Don't forget the 'up_read(osdc-map_sem)' if met error.

2013-07-16 Thread majianpeng
Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e0b4ef3..a5ce62e 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c @@ -196,8 +196,10 @@ static long

Re: Re: [PATCH 2/2] libceph: Remap notarget requests in handle_timeout.

2013-07-16 Thread majianpeng
On Tue, 16 Jul 2013, majianpeng wrote: If __map_request failed ,the request can't send and in list req_notarget. For those, they only remaped in func ceph_osdc_handle_map which update the epoch of osdmap.There are some reasons like ENOMEM which can't cause update epoch of osdmap.So

Re: Re: [PATCH] ceph: Don't do set_layout for file which has been written.

2013-07-14 Thread majianpeng
On Fri, 12 Jul 2013, majianpeng wrote: On Thu, 11 Jul 2013, majianpeng wrote: Cephfs don't change the layout which has been written.So add this check before do. This could conceivaably change in the future, and I'm not sure there is harm is the MDS round trip to get the error code here

[PATCH] libceph: Unregister request if __map_request failed.

2013-07-12 Thread majianpeng
In func ceph_osdc_start_request, if __mape_request failed, it should call __unregister_request avoid cause bugs, etc memleak, umount fs failed. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- net/ceph/osd_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ceph/osd_client.c

Re: Re: [PATCH] ceph:Update the file time after mmap-write.

2013-07-11 Thread majianpeng
On Thu, Jul 11, 2013 at 9:17 AM, majianpeng majianp...@gmail.com wrote: Although, mmap-write of ceph update the time of file using file_update_time.Because it don't mark the relative cap so the time can't save. I think cephfs' mmap IO support is still broken. mmap IO does not respect ceph

[PATCH] ceph: Don't get layout from mds for regular file which has been written.

2013-07-11 Thread majianpeng
For regular file which has been written, it can't change layout. So it can get layout from local rather than mds. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/ioctl.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c

Re: Re: [PATCH] ceph: Don't do set_layout for file which has been written.

2013-07-11 Thread majianpeng
On Thu, 11 Jul 2013, majianpeng wrote: Cephfs don't change the layout which has been written.So add this check before do. This could conceivaably change in the future, and I'm not sure there is harm is the MDS round trip to get the error code here...? Sorry, i can't understand what's your

Re: Re: [PATCH] ceph:Update the file time after mmap-write.

2013-07-11 Thread majianpeng
On Thu, Jul 11, 2013 at 3:53 PM, majianpeng majianp...@gmail.com wrote: On Thu, Jul 11, 2013 at 9:17 AM, majianpeng majianp...@gmail.com wrote: Although, mmap-write of ceph update the time of file using file_update_time.Because it don't mark the relative cap so the time can't save. I think

[PATCH] ceph:Update the file time after mmap-write.

2013-07-10 Thread majianpeng
Although, mmap-write of ceph update the time of file using file_update_time.Because it don't mark the relative cap so the time can't save. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/addr.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/ceph/addr.c

Re: Re: [PATCH] ceph:Update the file time after mmap-write.

2013-07-10 Thread majianpeng
On Thu, Jul 11, 2013 at 9:17 AM, majianpeng majianp...@gmail.com wrote: Although, mmap-write of ceph update the time of file using file_update_time.Because it don't mark the relative cap so the time can't save. I think cephfs' mmap IO support is still broken. mmap IO does not respect ceph

[PATCH] ceph: Don't do set_layout for file which has been written.

2013-07-10 Thread majianpeng
Cephfs don't change the layout which has been written.So add this check before do. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/ioctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e0b4ef3..cbea896 100644 --- a/fs/ceph/ioctl.c +++

[PATCH 2/2] ceph: for sync_read, call file_accessed to update atime.

2013-07-03 Thread majianpeng
For ceph_sync_read,it don't call file_accessed to update atime.But the buffer_read do it .So add it. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index fa74e6f..b0e6f0b 100644 ---

[RFC PATCH] ceph: send the ctime of file/snap when send a cap msg.

2013-07-02 Thread majianpeng
Now,when sent a cap msg to inode/snap, it don't include the ctime of inode/snap.So make the mtime ahead of ctime. BTY,for snap, i'm not exactly send the ctime of snap or null. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/caps.c | 11 +++ 1 file changed, 7 insertions(+), 4

Re: Re: [PATCH 1/3] mds: update atime if client can read.

2013-07-02 Thread majianpeng
On Tue, 2 Jul 2013, majianpeng wrote: Now, update atime only for CEPH_CAP_FILE_EXCL.Change this if CEPH_CAP_FILE_RD. Can we introduce a global config optoin (bool mds_atime in common/config_opts.h, maybe) so that users can turn this off? And/or add a 'relatime' option? More users won't want

[PATCH 1/2] ceph: update atime after read.

2013-07-02 Thread majianpeng
Now ceph don't update atime after read.So add this function. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 656e169..fa74e6f 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@

[PATCH 0/3] implement of updating atime for client has CEPH_CAP_FILE_RD

2013-07-01 Thread majianpeng
Now update atime of file, only for client had CEPH_CAP_FLE_EXCL.But for atime, if one can read he can update this attribte. For this feature,it need both client and mds modify. PATCH1,it modify the mds to support. PATCH2,it modify the client to suport. PATCH3, it support this feature for

[PATCH 3/3] ceph: For ceph_sync_read, update the atime of file.

2013-07-01 Thread majianpeng
For buffer read, the func generic_file_aio_read will update atime of file.But the ceph_sync_read don't do it.So add this. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index

[PATCH 2/3] ceph: update atime after read-operation.

2013-07-01 Thread majianpeng
Now ceph don't support updating atime after read-operation if the open mode is CEPH_CAP_FILE_RD.There are two reasons: 1:in client of fs,it don't set dirty cap of CEPH_CAP_FILE_RD. 2:in mds,it only update the atime if the condition dirty (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR) is true. But if we

[PATCH 1/3] mds: update atime if client can read.

2013-07-01 Thread majianpeng
Now, update atime only for CEPH_CAP_FILE_EXCL.Change this if CEPH_CAP_FILE_RD. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- src/mds/Locker.cc | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 30e014a..58f953f

[PATCH] ceph: Don't use ceph-sync-mode for synchronous-fs.

2013-06-27 Thread majianpeng
At now for synchronous-fs, all write-operations use ceph_sync_mode. But for the file which opened with O_SYNC, it don't use sync_mode. The behaviour of them should be the same. For fs which mounted using '-o sync', it want all I/O to the filesystem should be done synchronously.But the

[PATCH][TRIVIAL] ceph: Free the previous caps if alloc failed.

2013-06-25 Thread majianpeng
Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/caps.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index da0f9b8..626b0ec 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -203,6 +203,11 @@ out_alloc_count: /* we didn't manage to

Re: Re: [PATCH][TRIVIAL] ceph: Free the previous caps if alloc failed.

2013-06-25 Thread majianpeng
+= alloc; BTY, The function which call ceph_reserve_caps don't care the result. And from you comment, this will periodically do.So i think the function proto will be viod ceph_reserve_caps() { } How about this? Thanks! Jianpeng Ma sage On Tue, 25 Jun 2013, majianpeng wrote: Signed-off

[PATCH] ceph: Reconstruct the func ceph_reserve_caps.

2013-06-25 Thread majianpeng
Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/caps.c | 21 +++-- fs/ceph/super.h | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index da0f9b8..6d2655c 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@

[PATCH] libceph: Call con-ops-put(con) if cancel_delayed_work(con-work) worked.

2013-06-23 Thread majianpeng
Because in func queue_con_delay, it will call con-ops-get(con). So if we cancel the work successfully,we must call con-ops-put(con). Otherwise some resource can't free like 'struct ceph_mds_session'. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- net/ceph/messenger.c | 3 ++- 1 file

[PATCH V1] ceph: fix sleeping function called from invalid context.

2013-06-19 Thread majianpeng
[ 1121.231883] BUG: sleeping function called from invalid context at kernel/rwsem.c:20 [ 1121.231935] in_atomic(): 1, irqs_disabled(): 0, pid: 9831, name: mv [ 1121.231971] 1 lock held by mv/9831: [ 1121.231973] #0: ((ci-i_ceph_lock)-rlock){+.+...},at:[a02bbd38]

[PATCH] ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.

2013-06-19 Thread majianpeng
Signed-off-by: Jianpeng Ma majianp...@gmail.com --- fs/ceph/addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 3e68ac1..25fa8b8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -677,8 +677,8 @@ static int

[PATCH] ceph: fix sleeping function called from invalid context.

2013-06-18 Thread majianpeng
[ 1121.231883] BUG: sleeping function called from invalid context at kernel/rwsem.c:20 [ 1121.231935] in_atomic(): 1, irqs_disabled(): 0, pid: 9831, name: mv [ 1121.231971] 1 lock held by mv/9831: [ 1121.231973] #0: ((ci-i_ceph_lock)-rlock){+.+...}, at:[a02bbd38]

Re: Re: [PATCH] ceph: fix sleeping function called from invalid context.

2013-06-18 Thread majianpeng
On Tue, 18 Jun 2013, majianpeng wrote: [ 1121.231883] BUG: sleeping function called from invalid context at kernel/rwsem.c:20 [ 1121.231935] in_atomic(): 1, irqs_disabled(): 0, pid: 9831, name: mv [ 1121.231971] 1 lock held by mv/9831: [ 1121.231973] #0: ((ci-i_ceph_lock)-rlock

[PATCH] ceph: remove sb_start/end_write in ceph_aio_write.

2013-06-17 Thread majianpeng
Either in vfs_write or io_submit,it call file_start/end_write. The different between file_start/end_write and sb_start/end_write is file_ only handle regular file.But i think in ceph_aio_write,it only for regular file. Signed-off-by: Jianpeng Mamajianp...@gmail.com --- fs/ceph/file.c | 2 -- 1