소스 검색

ceph: check zero length in ceph_sync_read()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Yan, Zheng 11 년 전
부모
커밋
d0d0db2268
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      fs/ceph/file.c

+ 3 - 0
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,