Re: [PATCH] btrfs: emit BTRFS_SEND_C_FILEATTR during full mode

From: Qu Wenruo

Date: Tue Jun 16 2026 - 23:15:44 EST




在 2026/6/17 04:07, Mateusz Poliwczak 写道:
Currently BTRFS_SEND_C_FILEATTR is only emmited during incremental
mode when fileattr change between snapshots. This change makes sure
we also emit BTRFS_SEND_C_FILEATTR when sending the full snapshot.

Please explain why.

And there is no signed-off-by required by upstream.

---
fs/btrfs/send.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 3ae480c7474b..effbe7ac1a81 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -6575,8 +6575,10 @@ static int finish_inode_if_needed(struct send_ctx *sctx, bool at_end)
if (!sctx->parent_root || sctx->cur_inode_new) {
need_chown = true;
- if (!S_ISLNK(sctx->cur_inode_mode))
+ if (!S_ISLNK(sctx->cur_inode_mode)) {
need_chmod = true;
+ need_fileattr = true;
+ }
if (sctx->cur_inode_next_write_offset == sctx->cur_inode_size)
need_truncate = false;
} else {