summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-09-21 09:15:10 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-09-23 08:58:52 -0700
commit2dbf872c042eaf7315d35752b6222c7c832112fd (patch)
tree04ab4bd3d649d2392907b55b1bbaac30896fe5d3 /fs/xfs/xfs_bmap_item.c
parent93293bcbde93567efaf4e6bcd58cad270e1fcbf5 (diff)
xfs: attach inode to dquot in xfs_bui_item_recover
In the bmap intent item recovery code, we must be careful to attach the inode to its dquots (if quotas are enabled) so that a change in the shape of the bmap btree doesn't cause the quota counters to be incorrect. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_bmap_item.c')
-rw-r--r--fs/xfs/xfs_bmap_item.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c
index 815a0563288f..2b1cf3ed8172 100644
--- a/fs/xfs/xfs_bmap_item.c
+++ b/fs/xfs/xfs_bmap_item.c
@@ -24,6 +24,7 @@
#include "xfs_error.h"
#include "xfs_log_priv.h"
#include "xfs_log_recover.h"
+#include "xfs_quota.h"
kmem_zone_t *xfs_bui_zone;
kmem_zone_t *xfs_bud_zone;
@@ -498,6 +499,10 @@ xfs_bui_item_recover(
if (error)
goto err_inode;
+ error = xfs_qm_dqattach_locked(ip, false);
+ if (error)
+ goto err_inode;
+
if (VFS_I(ip)->i_nlink == 0)
xfs_iflags_set(ip, XFS_IRECOVERY);