Commit 2dbf872c authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 93293bcb
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "xfs_error.h" #include "xfs_error.h"
#include "xfs_log_priv.h" #include "xfs_log_priv.h"
#include "xfs_log_recover.h" #include "xfs_log_recover.h"
#include "xfs_quota.h"
kmem_zone_t *xfs_bui_zone; kmem_zone_t *xfs_bui_zone;
kmem_zone_t *xfs_bud_zone; kmem_zone_t *xfs_bud_zone;
...@@ -498,6 +499,10 @@ xfs_bui_item_recover( ...@@ -498,6 +499,10 @@ xfs_bui_item_recover(
if (error) if (error)
goto err_inode; goto err_inode;
error = xfs_qm_dqattach_locked(ip, false);
if (error)
goto err_inode;
if (VFS_I(ip)->i_nlink == 0) if (VFS_I(ip)->i_nlink == 0)
xfs_iflags_set(ip, XFS_IRECOVERY); xfs_iflags_set(ip, XFS_IRECOVERY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment