diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2014-07-20 22:15:48 -0400 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2014-07-20 22:17:05 -0400 |
commit | d0d0db2268cc343c2361c83510d8e9711021fcce (patch) | |
tree | 6a943b1002888c6d2f09f55c829c9538511a2f8d /fs/ceph/file.c | |
parent | 51da8e8c6f687ff94d4a7d39633f7547d944321f (diff) |
ceph: check zero length in ceph_sync_read()
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index fec9ddcf1528..c66d4b436437 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -423,6 +423,9 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *i, | |||
423 | dout("sync_read on file %p %llu~%u %s\n", file, off, | 423 | dout("sync_read on file %p %llu~%u %s\n", file, off, |
424 | (unsigned)len, | 424 | (unsigned)len, |
425 | (file->f_flags & O_DIRECT) ? "O_DIRECT" : ""); | 425 | (file->f_flags & O_DIRECT) ? "O_DIRECT" : ""); |
426 | |||
427 | if (!len) | ||
428 | return 0; | ||
426 | /* | 429 | /* |
427 | * flush any page cache pages in this range. this | 430 | * flush any page cache pages in this range. this |
428 | * will make concurrent normal and sync io slow, | 431 | * will make concurrent normal and sync io slow, |