summaryrefslogtreecommitdiff
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-10-25 10:51:55 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-12-12 23:54:27 +0100
commit2b1ac852eb67a6e95595e576371d23519105559f (patch)
tree076e01b89275932db841f55fb604744b5c84bc5a /fs/ceph/file.c
parent5c341ee32881c554727ec14b71ec3e8832f01989 (diff)
ceph: try getting buffer capability for readahead/fadvise
For readahead/fadvise cases, caller of ceph_readpages does not hold buffer capability. Pages can be added to page cache while there is no buffer capability. This can cause data integrity issue. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 10cd6acad44c..ae3cec5724d6 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1249,8 +1249,9 @@ again:
dout("aio_read %p %llx.%llx %llu~%u got cap refs on %s\n",
inode, ceph_vinop(inode), iocb->ki_pos, (unsigned)len,
ceph_cap_string(got));
-
+ current->journal_info = filp;
ret = generic_file_read_iter(iocb, to);
+ current->journal_info = NULL;
}
dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);