From d0d0db2268cc343c2361c83510d8e9711021fcce Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 21 Jul 2014 10:15:48 +0800 Subject: ceph: check zero length in ceph_sync_read() Signed-off-by: Yan, Zheng --- fs/ceph/file.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/ceph/file.c') 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, 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, -- cgit