diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-03-01 10:57:54 +0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-01 21:16:11 -0700 |
commit | 3f99969f42300e52779ae0656678c2534097f2ea (patch) | |
tree | b3b07bc105f3c966c8a50e0d2e3bac5e5f3b4eeb /fs/ceph/file.c | |
parent | 6070e0c1e2b515ad5edc2f8224031b051bd08109 (diff) | |
download | talos-op-linux-3f99969f42300e52779ae0656678c2534097f2ea.tar.gz talos-op-linux-3f99969f42300e52779ae0656678c2534097f2ea.zip |
ceph: acquire i_mutex in __ceph_do_pending_vmtruncate
make __ceph_do_pending_vmtruncate() acquire the i_mutex if the caller
does not hold the i_mutex, so ceph_aio_read() can call safely.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 3d1aefeee948..dd47026c6064 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -653,7 +653,7 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov, dout("aio_read %p %llx.%llx %llu~%u trying to get caps on %p\n", inode, ceph_vinop(inode), pos, (unsigned)len, inode); again: - __ceph_do_pending_vmtruncate(inode); + __ceph_do_pending_vmtruncate(inode, true); if (fi->fmode & CEPH_FILE_MODE_LAZY) want = CEPH_CAP_FILE_CACHE | CEPH_CAP_FILE_LAZYIO; else @@ -730,7 +730,7 @@ retry_snap: ret = -ENOSPC; goto out; } - __ceph_do_pending_vmtruncate(inode); + __ceph_do_pending_vmtruncate(inode, true); dout("aio_write %p %llx.%llx %llu~%u getting caps. i_size %llu\n", inode, ceph_vinop(inode), pos, (unsigned)iov->iov_len, inode->i_size); @@ -801,7 +801,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence) int ret; mutex_lock(&inode->i_mutex); - __ceph_do_pending_vmtruncate(inode); + __ceph_do_pending_vmtruncate(inode, false); if (whence == SEEK_END || whence == SEEK_DATA || whence == SEEK_HOLE) { ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE); |