android_kernel_samsung_msm8976/fs/ceph
majianpeng 533bc2950e ceph: fix bugs about handling short-read for sync read mode.
commit 02ae66d8b229708fd94b764f6c17ead1c7741fcf upstream.

cephfs . show_layout
>layyout.data_pool:     0
>layout.object_size:   4194304
>layout.stripe_unit:   4194304
>layout.stripe_count:  1

TestA:
>dd if=/dev/urandom of=test bs=1M count=2 oflag=direct
>dd if=/dev/urandom of=test bs=1M count=2 seek=4  oflag=direct
>dd if=test of=/dev/null bs=6M count=1 iflag=direct
The messages from func striped_read are:
ceph:           file.c:350  : striped_read 0~6291456 (read 0) got 2097152 HITSTRIPE SHORT
ceph:           file.c:350  : striped_read 2097152~4194304 (read 2097152) got 0 HITSTRIPE SHORT
ceph:           file.c:381  : zero tail 4194304
ceph:           file.c:390  : striped_read returns 6291456
The hole of file is from 2M--4M.But actualy it zero the last 4M include
the last 2M area which isn't a hole.
Using this patch, the messages are:
ceph:           file.c:350  : striped_read 0~6291456 (read 0) got 2097152 HITSTRIPE SHORT
ceph:           file.c:358  :  zero gap 2097152 to 4194304
ceph:           file.c:350  : striped_read 4194304~2097152 (read 4194304) got 2097152
ceph:           file.c:384  : striped_read returns 6291456

TestB:
>echo majianpeng > test
>dd if=test of=/dev/null bs=2M count=1 iflag=direct
The messages are:
ceph:           file.c:350  : striped_read 0~6291456 (read 0) got 11 HITSTRIPE SHORT
ceph:           file.c:350  : striped_read 11~6291445 (read 11) got 0 HITSTRIPE SHORT
ceph:           file.c:390  : striped_read returns 11
For this case,it did once more striped_read.It's no meaningless.
Using this patch, the message are:
ceph:           file.c:350  : striped_read 0~6291456 (read 0) got 11 HITSTRIPE SHORT
ceph:           file.c:384  : striped_read returns 11

Big thanks to Yan Zheng for the patch.

Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 12:24:25 -08:00
..
addr.c ceph: Avoid data inconsistency due to d-cache aliasing in readpage() 2014-01-09 12:24:22 -08:00
caps.c ceph: take i_mutex before getting Fw cap 2013-05-01 21:18:53 -07:00
ceph_frag.c
debugfs.c
dir.c ceph: use i_release_count to indicate dir's completeness 2013-05-01 21:17:07 -07:00
export.c fs: encode_fh: return FILEID_INVALID if invalid fid_type 2013-02-26 02:46:10 -05:00
file.c ceph: fix bugs about handling short-read for sync read mode. 2014-01-09 12:24:25 -08:00
inode.c ceph: fix symlink inode operations 2013-05-01 21:18:50 -07:00
ioctl.c ceph: Add check returned value on func ceph_calc_ceph_pg. 2014-01-09 12:24:25 -08:00
ioctl.h
Kconfig fs/ceph: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:39:04 -08:00
locks.c ceph: ceph_pagelist_append might sleep while atomic 2013-05-17 12:45:48 -05:00
Makefile
mds_client.c ceph: fix null pointer dereference 2014-01-09 12:24:25 -08:00
mds_client.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-02-28 17:43:09 -08:00
mdsmap.c ceph: improve error handling in ceph_mdsmap_decode 2014-01-09 12:24:24 -08:00
snap.c ceph: use ceph_create_snap_context() 2013-05-01 21:20:09 -07:00
strings.c libceph: update ceph_mds_state_name() and ceph_mds_op_name() 2013-02-18 12:20:34 -06:00
super.c ceph: avoid accessing invalid memory 2014-01-09 12:24:25 -08:00
super.h ceph: ceph_pagelist_append might sleep while atomic 2013-05-17 12:45:48 -05:00
xattr.c ceph: fix sleeping function called from invalid context. 2013-07-13 11:42:26 -07:00