X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Focfs2%2Frefcounttree.c;h=636aab69ead559f718a9ebef4e6ca5e8dfad933e;hb=185829efb867120683b7245c60baf06f831aabf6;hp=714e53b9cc6606a178ee2c8f0121fd12156c0539;hpb=28e48f0e262fd94a613613d06ac5eaf6745b18a8;p=cascardo%2Flinux.git diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 714e53b9cc66..636aab69ead5 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -4288,9 +4288,16 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir, goto out; } + error = ocfs2_rw_lock(inode, 1); + if (error) { + mlog_errno(error); + goto out; + } + error = ocfs2_inode_lock(inode, &old_bh, 1); if (error) { mlog_errno(error); + ocfs2_rw_unlock(inode, 1); goto out; } @@ -4302,6 +4309,7 @@ static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir, up_write(&OCFS2_I(inode)->ip_xattr_sem); ocfs2_inode_unlock(inode, 1); + ocfs2_rw_unlock(inode, 1); brelse(old_bh); if (error) {