]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: use ->t_firstblock in xattr ops
authorBrian Foster <bfoster@redhat.com>
Fri, 5 Oct 2018 02:36:08 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:08 +0000 (21:36 -0500)
commitd2391b24ebcaada6d798996104a1abf4abcaf6e5
treed1ff32098c12e5c3a5a68f03b43e738b858b7eed
parentd9313ca41879bed92d73520494fd168f5f6084ec
xfs: use ->t_firstblock in xattr ops

Source kernel commit: 766139032f95bb41031f6de9c2ee0538bd035229

Similar to the dirops code, the xattr code uses an on-stack
firstblock variable for the various operations. This code rolls the
underlying transaction in various places, however, which means we
cannot simply replace the local firstblock vars with ->t_firstblock.
Doing so (without further changes) would invalidate the memory
pointed to by xfs_da_args.firstblock as soon as the first
transaction rolls.

To avoid this problem, remove xfs_da_args.firstblock and replace all
such accesses with ->t_firstblock at the same time. This ensures
that accesses to the current firstblock always occur through the
current transaction rather than a potentially invalid xfs_da_args
pointer.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c
libxfs/xfs_attr_remote.c
libxfs/xfs_bmap.c
libxfs/xfs_da_btree.c
libxfs/xfs_da_btree.h
libxfs/xfs_dir2.c
repair/phase6.c