Skip to content

DAOS-19249 dfs: support xattr operations on hardlinks#18611

Open
sherintg wants to merge 1 commit into
feature/dfs_hardlinksfrom
sherintg/dfs_hardlinks/DAOS-19249
Open

DAOS-19249 dfs: support xattr operations on hardlinks#18611
sherintg wants to merge 1 commit into
feature/dfs_hardlinksfrom
sherintg/dfs_hardlinks/DAOS-19249

Conversation

@sherintg

@sherintg sherintg commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Store extended attributes for hardlinked files in the Global Inode Table (GIT) keyed by OID so all links share a single set of xattrs. dfs_setxattr, dfs_getxattr, dfs_removexattr and dfs_listxattr now detect when a dfs_obj carries a stale mode (opened while the entry was still a regular file) and transparently retry against GIT once the on-disk entry has been converted to a hardlink.

dfs_setxattr additionally serializes concurrent hardlink conversion and xattr updates using a balanced-mode DTX when enabled, performing an explicit existence check in place of conditional akey updates.

Add DFS_UNIT_TEST30 covering get/set/list/remove across stale handles and multiple links, flag semantics, persistence and post-unlink behavior.
Allow-unstable-test: true

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

Store extended attributes for hardlinked files in the Global Inode
Table (GIT) keyed by OID so all links share a single set of xattrs.
dfs_setxattr, dfs_getxattr, dfs_removexattr and dfs_listxattr now
detect when a dfs_obj carries a stale mode (opened while the entry
was still a regular file) and transparently retry against GIT once
the on-disk entry has been converted to a hardlink.

dfs_setxattr additionally serializes concurrent hardlink conversion
and xattr updates using a balanced-mode DTX when enabled, performing
an explicit existence check in place of conditional akey updates.

Add DFS_UNIT_TEST30 covering get/set/list/remove across stale handles
and multiple links, flag semantics, persistence and post-unlink
behavior.
Allow-unstable-test: true

Signed-off-by: Sherin T George <sherin-t.george@hpe.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Ticket title is 'Add hardlink support to DFS xattr APIs'
Status is 'Open'
https://daosio.atlassian.net/browse/DAOS-19249

@sherintg sherintg marked this pull request as ready for review July 3, 2026 11:19
@sherintg sherintg requested review from a team as code owners July 3, 2026 11:19
@sherintg sherintg requested review from knard38 and mchaarawi July 3, 2026 11:19
Comment thread src/client/dfs/xattr.c
Comment on lines +118 to +123
/*
* Since this function deals with dfs_obj, the hardlink information in its
* mode field may be outdated. Check and update the mode with hardlink info.
* Retry if the hardlink bit is set.
*/
if (S_ISREG(obj->mode)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this is changing the original behavior. this is not acceptable.
You are revalidating the entry and adding and extra fetch. DFS already has this in many places, where the user is responsible of revalidating or close/reopening entries.

What if the entry handle changes under you right after this fetch completes?

Comment thread src/client/dfs/xattr.c
check_iod.iod_type = DAOS_IOD_SINGLE;
check_iod.iod_size = DAOS_REC_ANY;
rc = daos_obj_fetch(oh, th, DAOS_COND_AKEY_FETCH, &dkey, 1, &check_iod, NULL, NULL,
NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe ALL conditionals do not work properly with a DTX.
IMO you should just do the same logic as was done without a GIT, but for a hardlink file you do it in the GIT object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants