]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix short sync reads from the OSD
authorSage Weil <sage@newdream.net>
Wed, 1 Jun 2011 23:08:44 +0000 (16:08 -0700)
committerSage Weil <sage@newdream.net>
Wed, 8 Jun 2011 04:34:14 +0000 (21:34 -0700)
commitbbdd4604d10776a6ed38b96ec624a267116f9bbc
treefc7823426f29f44911c93394fb8a3e43d0c91846
parentc9566a197d2ca66ec30e2995fd2492ded0c97cad
ceph: fix short sync reads from the OSD

If we get a short read from the OSD because the object is small, we need to
zero the remainder of the buffer.  For O_DIRECT reads, the attempted range
is not trimmed to i_size by the VFS, so we were actually looping
indefinitely.

Fix by trimming by i_size, and the unconditionally zeroing the trailing
range.

Reported-by: Jeff Wu <cpwu@tnsoft.com.cn>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/file.c