mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
xfs: check parent pointer xattrs when scrubbing
Check parent pointer xattrs as part of scrubbing xattrs. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
77ede5f44b
commit
59a2af9086
1 changed files with 16 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include "xfs_attr.h"
|
#include "xfs_attr.h"
|
||||||
#include "xfs_attr_leaf.h"
|
#include "xfs_attr_leaf.h"
|
||||||
#include "xfs_attr_sf.h"
|
#include "xfs_attr_sf.h"
|
||||||
|
#include "xfs_parent.h"
|
||||||
#include "scrub/scrub.h"
|
#include "scrub/scrub.h"
|
||||||
#include "scrub/common.h"
|
#include "scrub/common.h"
|
||||||
#include "scrub/dabtree.h"
|
#include "scrub/dabtree.h"
|
||||||
|
@ -208,6 +209,13 @@ xchk_xattr_actor(
|
||||||
return -ECANCELED;
|
return -ECANCELED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check parent pointer record. */
|
||||||
|
if ((attr_flags & XFS_ATTR_PARENT) &&
|
||||||
|
!xfs_parent_valuecheck(sc->mp, value, valuelen)) {
|
||||||
|
xchk_fblock_set_corrupt(sc, XFS_ATTR_FORK, args.blkno);
|
||||||
|
return -ECANCELED;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to allocate enough memory to extract the attr value. If that
|
* Try to allocate enough memory to extract the attr value. If that
|
||||||
* doesn't work, return -EDEADLOCK as a signal to try again with a
|
* doesn't work, return -EDEADLOCK as a signal to try again with a
|
||||||
|
@ -219,6 +227,14 @@ xchk_xattr_actor(
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parent pointers are matched on attr name and value, so we must
|
||||||
|
* supply the xfs_parent_rec here when confirming that the dabtree
|
||||||
|
* indexing works correctly.
|
||||||
|
*/
|
||||||
|
if (attr_flags & XFS_ATTR_PARENT)
|
||||||
|
memcpy(ab->value, value, valuelen);
|
||||||
|
|
||||||
args.value = ab->value;
|
args.value = ab->value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue