diff options
Diffstat (limited to 'fs/ceph/inode.c')
| -rw-r--r-- | fs/ceph/inode.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index be0f7e20d62e..f3a2abf28a77 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
| @@ -903,8 +903,8 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, | |||
| 903 | } else if (realdn) { | 903 | } else if (realdn) { |
| 904 | dout("dn %p (%d) spliced with %p (%d) " | 904 | dout("dn %p (%d) spliced with %p (%d) " |
| 905 | "inode %p ino %llx.%llx\n", | 905 | "inode %p ino %llx.%llx\n", |
| 906 | dn, dn->d_count, | 906 | dn, d_count(dn), |
| 907 | realdn, realdn->d_count, | 907 | realdn, d_count(realdn), |
| 908 | realdn->d_inode, ceph_vinop(realdn->d_inode)); | 908 | realdn->d_inode, ceph_vinop(realdn->d_inode)); |
| 909 | dput(dn); | 909 | dput(dn); |
| 910 | dn = realdn; | 910 | dn = realdn; |
| @@ -1465,7 +1465,9 @@ static void ceph_vmtruncate_work(struct work_struct *work) | |||
| 1465 | struct inode *inode = &ci->vfs_inode; | 1465 | struct inode *inode = &ci->vfs_inode; |
| 1466 | 1466 | ||
| 1467 | dout("vmtruncate_work %p\n", inode); | 1467 | dout("vmtruncate_work %p\n", inode); |
| 1468 | __ceph_do_pending_vmtruncate(inode, true); | 1468 | mutex_lock(&inode->i_mutex); |
| 1469 | __ceph_do_pending_vmtruncate(inode); | ||
| 1470 | mutex_unlock(&inode->i_mutex); | ||
| 1469 | iput(inode); | 1471 | iput(inode); |
| 1470 | } | 1472 | } |
| 1471 | 1473 | ||
| @@ -1492,7 +1494,7 @@ void ceph_queue_vmtruncate(struct inode *inode) | |||
| 1492 | * Make sure any pending truncation is applied before doing anything | 1494 | * Make sure any pending truncation is applied before doing anything |
| 1493 | * that may depend on it. | 1495 | * that may depend on it. |
| 1494 | */ | 1496 | */ |
| 1495 | void __ceph_do_pending_vmtruncate(struct inode *inode, bool needlock) | 1497 | void __ceph_do_pending_vmtruncate(struct inode *inode) |
| 1496 | { | 1498 | { |
| 1497 | struct ceph_inode_info *ci = ceph_inode(inode); | 1499 | struct ceph_inode_info *ci = ceph_inode(inode); |
| 1498 | u64 to; | 1500 | u64 to; |
| @@ -1525,11 +1527,7 @@ retry: | |||
| 1525 | ci->i_truncate_pending, to); | 1527 | ci->i_truncate_pending, to); |
| 1526 | spin_unlock(&ci->i_ceph_lock); | 1528 | spin_unlock(&ci->i_ceph_lock); |
| 1527 | 1529 | ||
| 1528 | if (needlock) | ||
| 1529 | mutex_lock(&inode->i_mutex); | ||
| 1530 | truncate_inode_pages(inode->i_mapping, to); | 1530 | truncate_inode_pages(inode->i_mapping, to); |
| 1531 | if (needlock) | ||
| 1532 | mutex_unlock(&inode->i_mutex); | ||
| 1533 | 1531 | ||
| 1534 | spin_lock(&ci->i_ceph_lock); | 1532 | spin_lock(&ci->i_ceph_lock); |
| 1535 | if (to == ci->i_truncate_size) { | 1533 | if (to == ci->i_truncate_size) { |
| @@ -1588,7 +1586,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 1588 | if (ceph_snap(inode) != CEPH_NOSNAP) | 1586 | if (ceph_snap(inode) != CEPH_NOSNAP) |
| 1589 | return -EROFS; | 1587 | return -EROFS; |
| 1590 | 1588 | ||
| 1591 | __ceph_do_pending_vmtruncate(inode, false); | 1589 | __ceph_do_pending_vmtruncate(inode); |
| 1592 | 1590 | ||
| 1593 | err = inode_change_ok(inode, attr); | 1591 | err = inode_change_ok(inode, attr); |
| 1594 | if (err != 0) | 1592 | if (err != 0) |
| @@ -1770,7 +1768,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 1770 | ceph_cap_string(dirtied), mask); | 1768 | ceph_cap_string(dirtied), mask); |
| 1771 | 1769 | ||
| 1772 | ceph_mdsc_put_request(req); | 1770 | ceph_mdsc_put_request(req); |
| 1773 | __ceph_do_pending_vmtruncate(inode, false); | 1771 | __ceph_do_pending_vmtruncate(inode); |
| 1774 | return err; | 1772 | return err; |
| 1775 | out: | 1773 | out: |
| 1776 | spin_unlock(&ci->i_ceph_lock); | 1774 | spin_unlock(&ci->i_ceph_lock); |
