summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_attr.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-04-24 09:27:41 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-04-30 08:19:13 -0700
commit710d707d2fa9cf4c2aa9def129e71e99513466ea (patch)
tree2c718b082d98f4fd851f44a00b3c5e6229ec6b38 /fs/xfs/libxfs/xfs_attr.h
parent1749d1ea89bdf3181328b7d846e609d5a0e53e50 (diff)
downloadlinux-710d707d2fa9cf4c2aa9def129e71e99513466ea.tar.gz
linux-710d707d2fa9cf4c2aa9def129e71e99513466ea.tar.bz2
linux-710d707d2fa9cf4c2aa9def129e71e99513466ea.zip
xfs: always rejoin held resources during defer roll
During testing of xfs/141 on a V4 filesystem, I observed some inconsistent behavior with regards to resources that are held (i.e. remain locked) across a defer roll. The transaction roll always gives the defer roll function a new transaction, even if committing the old transaction fails. However, the defer roll function only rejoins the held resources if the transaction commit succeedied. This means that callers of defer roll have to figure out whether the held resources are attached to the transaction being passed back. Worse yet, if the defer roll was part of a defer finish call, we have a third possibility: the defer finish could pass back a dirty transaction with dirty held resources and an error code. The only sane way to handle all of these scenarios is to require that the code that held the resource either cancel the transaction before unlocking and releasing the resources, or use functions that detach resources from a transaction properly (e.g. xfs_trans_brelse) if they need to drop the reference before committing or cancelling the transaction. In order to make this so, change the defer roll code to join held resources to the new transaction unconditionally and fix all the bhold callers to release the held buffers correctly. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.h')
-rw-r--r--fs/xfs/libxfs/xfs_attr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h
index 2297d8467666..3b0dce06e454 100644
--- a/fs/xfs/libxfs/xfs_attr.h
+++ b/fs/xfs/libxfs/xfs_attr.h
@@ -140,7 +140,7 @@ int xfs_attr_get(struct xfs_inode *ip, const unsigned char *name,
unsigned char *value, int *valuelenp, int flags);
int xfs_attr_set(struct xfs_inode *dp, const unsigned char *name,
unsigned char *value, int valuelen, int flags);
-int xfs_attr_set_args(struct xfs_da_args *args, struct xfs_buf **leaf_bp);
+int xfs_attr_set_args(struct xfs_da_args *args);
int xfs_attr_remove(struct xfs_inode *dp, const unsigned char *name, int flags);
int xfs_attr_remove_args(struct xfs_da_args *args);
int xfs_attr_list(struct xfs_inode *dp, char *buffer, int bufsize,