xfs: elide defer work ->create_done if no intent [v2]

Christoph pointed out that the defer ops machinery doesn't need to call
 ->create_done if the deferred work item didn't generate a log intent
 item in the first place.  Let's clean that up and save an indirect call
 in the non-logged xattr update call path.
 
 v2: pick up rvb tags
 
 This has been lightly tested with fstests.  Enjoy!
 
 Signed-off-by: Darrick J. Wong <djwong@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ2qTKExjcn+O1o2YRKO3ySh0YRpgUCZXEx4wAKCRBKO3ySh0YR
 pjCsAP4z+FUZUEtxd2T32hITEsoEdNksZ5MgPJN0P1lfwoUuzgD9H4HQPQIgbsoY
 3aJl/vWE9Nat8jMf+BoujAq2Ns3t7AQ=
 =Nlvg
 -----END PGP SIGNATURE-----

Merge tag 'defer-elide-create-done-6.8_2023-12-06' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.8-mergeA

xfs: elide defer work ->create_done if no intent

Christoph pointed out that the defer ops machinery doesn't need to call
->create_done if the deferred work item didn't generate a log intent
item in the first place.  Let's clean that up and save an indirect call
in the non-logged xattr update call path.

This has been lightly tested with fstests.  Enjoy!

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>

* tag 'defer-elide-create-done-6.8_2023-12-06' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: elide ->create_done calls for unlogged deferred work
  xfs: document what LARP means
This commit is contained in:
Chandan Babu R 2023-12-07 14:10:55 +05:30
commit 9f334526ee
3 changed files with 13 additions and 3 deletions

View File

@ -201,6 +201,10 @@ xfs_defer_create_done(
const struct xfs_defer_op_type *ops = defer_op_types[dfp->dfp_type];
struct xfs_log_item *lip;
/* If there is no log intent item, there can be no log done item. */
if (!dfp->dfp_intent)
return;
/*
* Mark the transaction dirty, even on error. This ensures the
* transaction is aborted, which:

View File

@ -740,9 +740,6 @@ xfs_attr_create_done(
struct xfs_attri_log_item *attrip;
struct xfs_attrd_log_item *attrdp;
if (!intent)
return NULL;
attrip = ATTRI_ITEM(intent);
attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_NOFS | __GFP_NOFAIL);

View File

@ -229,6 +229,15 @@ pwork_threads_show(
}
XFS_SYSFS_ATTR_RW(pwork_threads);
/*
* The "LARP" (Logged extended Attribute Recovery Persistence) debugging knob
* sets the XFS_DA_OP_LOGGED flag on all xfs_attr_set operations performed on
* V5 filesystems. As a result, the intermediate progress of all setxattr and
* removexattr operations are tracked via the log and can be restarted during
* recovery. This is useful for testing xattr recovery prior to merging of the
* parent pointer feature which requires it to maintain consistency, and may be
* enabled for userspace xattrs in the future.
*/
static ssize_t
larp_store(
struct kobject *kobject,