aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-06-07 23:40:35 -0400
committerSage Weil <sage@newdream.net>2011-06-08 00:34:16 -0400
commit0e98728fa32d338907631349a8cc2afa07c0cb9a (patch)
tree589aaa9b8b973194a7185ff92d7a8a6fe9051edb /fs/ceph
parentc3cd62839aaa2cdb2b99687c9e44f1b300a4aece (diff)
ceph: fix ENOENT logic in striped_read
Getting ENOENT is equivalent to reading 0 bytes. Make that correction before setting up the hit_stripe and was_short flags. Fixes the following case: dd if=/dev/zero of=/mnt/fs_depot/dd3 bs=1 seek=1048576 count=0 dd if=/mnt/fs_depot/dd3 of=/root/ddout1 skip=8 bs=500 count=2 iflag=direct Reported-by: Henry C Chang <henry.cy.chang@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index b654f403139e..9542f07d0b93 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -318,10 +318,10 @@ more:
318 ci->i_truncate_seq, 318 ci->i_truncate_seq,
319 ci->i_truncate_size, 319 ci->i_truncate_size,
320 page_pos, pages_left, page_align); 320 page_pos, pages_left, page_align);
321 hit_stripe = this_len < left;
322 was_short = ret >= 0 && ret < this_len;
323 if (ret == -ENOENT) 321 if (ret == -ENOENT)
324 ret = 0; 322 ret = 0;
323 hit_stripe = this_len < left;
324 was_short = ret >= 0 && ret < this_len;
325 dout("striped_read %llu~%u (read %u) got %d%s%s\n", pos, left, read, 325 dout("striped_read %llu~%u (read %u) got %d%s%s\n", pos, left, read,
326 ret, hit_stripe ? " HITSTRIPE" : "", was_short ? " SHORT" : ""); 326 ret, hit_stripe ? " HITSTRIPE" : "", was_short ? " SHORT" : "");
327 327