diff options
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r-- | fs/xfs/xfs_bmap_util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 6c876012b2e5..a32c1dcae2ff 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c | |||
@@ -203,10 +203,12 @@ xfs_bmap_rtalloc( | |||
203 | ralen = MAXEXTLEN / mp->m_sb.sb_rextsize; | 203 | ralen = MAXEXTLEN / mp->m_sb.sb_rextsize; |
204 | 204 | ||
205 | /* | 205 | /* |
206 | * Lock out other modifications to the RT bitmap inode. | 206 | * Lock out modifications to both the RT bitmap and summary inodes |
207 | */ | 207 | */ |
208 | xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); | 208 | xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); |
209 | xfs_trans_ijoin(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL); | 209 | xfs_trans_ijoin(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL); |
210 | xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL); | ||
211 | xfs_trans_ijoin(ap->tp, mp->m_rsumip, XFS_ILOCK_EXCL); | ||
210 | 212 | ||
211 | /* | 213 | /* |
212 | * If it's an allocation to an empty file at offset 0, | 214 | * If it's an allocation to an empty file at offset 0, |
@@ -822,7 +824,7 @@ bool | |||
822 | xfs_can_free_eofblocks(struct xfs_inode *ip, bool force) | 824 | xfs_can_free_eofblocks(struct xfs_inode *ip, bool force) |
823 | { | 825 | { |
824 | /* prealloc/delalloc exists only on regular files */ | 826 | /* prealloc/delalloc exists only on regular files */ |
825 | if (!S_ISREG(ip->i_d.di_mode)) | 827 | if (!S_ISREG(VFS_I(ip)->i_mode)) |
826 | return false; | 828 | return false; |
827 | 829 | ||
828 | /* | 830 | /* |
@@ -1727,7 +1729,7 @@ xfs_swap_extents( | |||
1727 | xfs_lock_two_inodes(ip, tip, XFS_MMAPLOCK_EXCL); | 1729 | xfs_lock_two_inodes(ip, tip, XFS_MMAPLOCK_EXCL); |
1728 | 1730 | ||
1729 | /* Verify that both files have the same format */ | 1731 | /* Verify that both files have the same format */ |
1730 | if ((ip->i_d.di_mode & S_IFMT) != (tip->i_d.di_mode & S_IFMT)) { | 1732 | if ((VFS_I(ip)->i_mode & S_IFMT) != (VFS_I(tip)->i_mode & S_IFMT)) { |
1731 | error = -EINVAL; | 1733 | error = -EINVAL; |
1732 | goto out_unlock; | 1734 | goto out_unlock; |
1733 | } | 1735 | } |