Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0d0db22 authored by Yan, Zheng's avatar Yan, Zheng
Browse files

ceph: check zero length in ceph_sync_read()

parent 51da8e8c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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,