[Bug 271925] chflags(1) fails to remove uarch flag with hardlinked files (ZFS)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 10 Jun 2023 07:06:14 UTC

Stefan Eßer <se@FreeBSD.org> changed:

           What    |Removed                     |Added
                 CC|                            |se@FreeBSD.org

--- Comment #1 from Stefan Eßer <se@FreeBSD.org> ---
Created attachment 242708
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=242708&action=edit
Update stat info of file to be changed

This seems to be caused by ZFS collecting multiple flag updates and by
effectively mapping the setting of flags to toggling of flags.

I'm not sure that I fully understand the complex mapping of attributes in
sys/module/os/freebsd/zfs/zfs_vnops_os.c (line 4888ff), but I guess that the
second call sees that the new attributes are identical to the (already altered)
current attributes of the file and then marks it to not need a vnode update on
stable storage.

Anyway, the attached simple patch fixes the issue on ZFS. I chose to update the
flags in place instead of in a separate stat structure.

You are receiving this mail because:
You are the assignee for the bug.