ceph: check zero length in ceph_sync_read()
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 21 Jul 2014 02:15:48 +0000 (10:15 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 21 Jul 2014 02:17:05 +0000 (10:17 +0800)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
fs/ceph/file.c

index fec9ddcf1528a8cf009ff371f4534c4da5e28fa5..c66d4b4364370163d2c1ac1fed43b25682e8b0a0 100644 (file)
@@ -423,6 +423,9 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *i,
        dout("sync_read on file %p %llu~%u %s\n", file, off,
             (unsigned)len,
             (file->f_flags & O_DIRECT) ? "O_DIRECT" : "");
+
+       if (!len)
+               return 0;
        /*
         * flush any page cache pages in this range.  this
         * will make concurrent normal and sync io slow,