Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull Ceph updates from Sage Weil: "There is some follow-on RBD cleanup after the last window's code drop, a series from Yan fixing multi-mds behavior in cephfs, and then a sprinkling of bug fixes all around. Some warnings, sleeping while atomic, a null dereference, and cleanups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (36 commits) libceph: fix invalid unsigned->signed conversion for timespec encoding libceph: call r_unsafe_callback when unsafe reply is received ceph: fix race between cap issue and revoke ceph: fix cap revoke race ceph: fix pending vmtruncate race ceph: avoid accessing invalid memory libceph: Fix NULL pointer dereference in auth client code ceph: Reconstruct the func ceph_reserve_caps. ceph: Free mdsc if alloc mdsc->mdsmap failed. ceph: remove sb_start/end_write in ceph_aio_write. ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL. ceph: fix sleeping function called from invalid context. ceph: move inode to proper flushing list when auth MDS changes rbd: fix a couple warnings ceph: clear migrate seq when MDS restarts ceph: check migrate seq before changing auth cap ceph: fix race between page writeback and truncate ceph: reset iov_len when discarding cap release messages ceph: fix cap release race libceph: fix truncate size calculation ...
This commit is contained in:
@@ -1465,7 +1465,9 @@ static void ceph_vmtruncate_work(struct work_struct *work)
|
||||
struct inode *inode = &ci->vfs_inode;
|
||||
|
||||
dout("vmtruncate_work %p\n", inode);
|
||||
__ceph_do_pending_vmtruncate(inode, true);
|
||||
mutex_lock(&inode->i_mutex);
|
||||
__ceph_do_pending_vmtruncate(inode);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
iput(inode);
|
||||
}
|
||||
|
||||
@@ -1492,7 +1494,7 @@ void ceph_queue_vmtruncate(struct inode *inode)
|
||||
* Make sure any pending truncation is applied before doing anything
|
||||
* that may depend on it.
|
||||
*/
|
||||
void __ceph_do_pending_vmtruncate(struct inode *inode, bool needlock)
|
||||
void __ceph_do_pending_vmtruncate(struct inode *inode)
|
||||
{
|
||||
struct ceph_inode_info *ci = ceph_inode(inode);
|
||||
u64 to;
|
||||
@@ -1525,11 +1527,7 @@ retry:
|
||||
ci->i_truncate_pending, to);
|
||||
spin_unlock(&ci->i_ceph_lock);
|
||||
|
||||
if (needlock)
|
||||
mutex_lock(&inode->i_mutex);
|
||||
truncate_inode_pages(inode->i_mapping, to);
|
||||
if (needlock)
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
|
||||
spin_lock(&ci->i_ceph_lock);
|
||||
if (to == ci->i_truncate_size) {
|
||||
@@ -1588,7 +1586,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
if (ceph_snap(inode) != CEPH_NOSNAP)
|
||||
return -EROFS;
|
||||
|
||||
__ceph_do_pending_vmtruncate(inode, false);
|
||||
__ceph_do_pending_vmtruncate(inode);
|
||||
|
||||
err = inode_change_ok(inode, attr);
|
||||
if (err != 0)
|
||||
@@ -1770,7 +1768,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
ceph_cap_string(dirtied), mask);
|
||||
|
||||
ceph_mdsc_put_request(req);
|
||||
__ceph_do_pending_vmtruncate(inode, false);
|
||||
__ceph_do_pending_vmtruncate(inode);
|
||||
return err;
|
||||
out:
|
||||
spin_unlock(&ci->i_ceph_lock);
|
||||
|
Reference in New Issue
Block a user