Message ID | 167899414483.15363.18330355264115568396.stgit@frogsfrogsfrogs (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xfs: encode parent pointer name in xattr key | expand |
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 996ef24482e1..1a047099e9c7 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -426,9 +426,15 @@ xfs_attr_complete_op( return XFS_DAS_DONE; args->attr_filter &= ~XFS_ATTR_INCOMPLETE; - if (args->new_namelen == 0) + if (xfs_attr_intent_op(attr) != XFS_ATTRI_OP_FLAGS_NVREPLACE) return replace_state; + /* + * NVREPLACE operations require the caller to set the old and new names + * explicitly. + */ + ASSERT(args->new_namelen > 0); + args->name = args->new_name; args->namelen = args->new_namelen; args->hashval = xfs_da_hashname(args->name, args->namelen);