Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: prevent deadlock in xfs_qm_shake() xfs: fix overflow in xfs_growfs_data_private xfs: fix double unlock in xfs_swap_extents()
This commit is contained in:
@@ -103,7 +103,7 @@ extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast);
|
|||||||
static inline int
|
static inline int
|
||||||
kmem_shake_allow(gfp_t gfp_mask)
|
kmem_shake_allow(gfp_t gfp_mask)
|
||||||
{
|
{
|
||||||
return (gfp_mask & __GFP_WAIT) != 0;
|
return ((gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_FS));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __XFS_SUPPORT_KMEM_H__ */
|
#endif /* __XFS_SUPPORT_KMEM_H__ */
|
||||||
|
@@ -347,13 +347,15 @@ xfs_swap_extents(
|
|||||||
|
|
||||||
error = xfs_trans_commit(tp, XFS_TRANS_SWAPEXT);
|
error = xfs_trans_commit(tp, XFS_TRANS_SWAPEXT);
|
||||||
|
|
||||||
out_unlock:
|
|
||||||
xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
|
|
||||||
xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
|
|
||||||
out:
|
out:
|
||||||
kmem_free(tempifp);
|
kmem_free(tempifp);
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
out_unlock:
|
||||||
|
xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
|
||||||
|
xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
|
||||||
|
goto out;
|
||||||
|
|
||||||
out_trans_cancel:
|
out_trans_cancel:
|
||||||
xfs_trans_cancel(tp, 0);
|
xfs_trans_cancel(tp, 0);
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
@@ -160,7 +160,7 @@ xfs_growfs_data_private(
|
|||||||
nagcount = new + (nb_mod != 0);
|
nagcount = new + (nb_mod != 0);
|
||||||
if (nb_mod && nb_mod < XFS_MIN_AG_BLOCKS) {
|
if (nb_mod && nb_mod < XFS_MIN_AG_BLOCKS) {
|
||||||
nagcount--;
|
nagcount--;
|
||||||
nb = nagcount * mp->m_sb.sb_agblocks;
|
nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks;
|
||||||
if (nb < mp->m_sb.sb_dblocks)
|
if (nb < mp->m_sb.sb_dblocks)
|
||||||
return XFS_ERROR(EINVAL);
|
return XFS_ERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user