aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/send.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 97cc5399306b..e78b297b0b00 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -4067,22 +4067,21 @@ static int finish_inode_if_needed(struct send_ctx *sctx, int at_end)
4067 if (ret < 0) 4067 if (ret < 0)
4068 goto out; 4068 goto out;
4069 4069
4070 if (!S_ISLNK(sctx->cur_inode_mode)) { 4070 if (!sctx->parent_root || sctx->cur_inode_new) {
4071 if (!sctx->parent_root || sctx->cur_inode_new) { 4071 need_chown = 1;
4072 if (!S_ISLNK(sctx->cur_inode_mode))
4072 need_chmod = 1; 4073 need_chmod = 1;
4073 need_chown = 1; 4074 } else {
4074 } else { 4075 ret = get_inode_info(sctx->parent_root, sctx->cur_ino,
4075 ret = get_inode_info(sctx->parent_root, sctx->cur_ino, 4076 NULL, NULL, &right_mode, &right_uid,
4076 NULL, NULL, &right_mode, &right_uid, 4077 &right_gid, NULL);
4077 &right_gid, NULL); 4078 if (ret < 0)
4078 if (ret < 0) 4079 goto out;
4079 goto out;
4080 4080
4081 if (left_uid != right_uid || left_gid != right_gid) 4081 if (left_uid != right_uid || left_gid != right_gid)
4082 need_chown = 1; 4082 need_chown = 1;
4083 if (left_mode != right_mode) 4083 if (!S_ISLNK(sctx->cur_inode_mode) && left_mode != right_mode)
4084 need_chmod = 1; 4084 need_chmod = 1;
4085 }
4086 } 4085 }
4087 4086
4088 if (S_ISREG(sctx->cur_inode_mode)) { 4087 if (S_ISREG(sctx->cur_inode_mode)) {