btrfs-progs/cmds
Filipe Manana dd7c458cb3 btrfs-progs: receive: work around failure of fileattr commands
Currently fileattr commands, introduced in the send stream v2, always
fail, since we have commented the FS_IOC_SETFLAGS ioctl() call and set
'ret' to -EOPNOTSUPP, which is then overwritten to -errno, which may
have a random value since it was not initialized before. This results
in a failure like this:

   ERROR: fileattr: set file attributes on p0/f1 failed: Invalid argument

The error reason may be something else, since errno is undefined at
this point.

Unfortunately we don't have a way yet to apply attributes, since the
attributes value we get from the kernel is what we store in flags field
of the inode item. This means that for example we can not just call
FS_IOC_SETFLAGS with the values we got, since they need to be converted
from BTRFS_INODE_* flags to FS_* flags

Besides that we'll have to reorder how we apply certain attributes like
FS_NOCOW_FL for example, which must happen always on an empty file and
right now we run write commands before attempting to change attributes,
as that's the order the kernel sends the operations.

So for now comment all the code, so that anyone using the v2 stream will
not have a receive failure but will get a behaviour like the v1 stream:
file attributes are ignored. This will have to be fixed later, but right
now people can't use a send stream v2 for the purpose of getting better
performance by avoid decompressing extents at the source and compression
of the data at the destination.

Link: https://lore.kernel.org/linux-btrfs/6cb11fa5-c60d-e65b-0295-301a694e66ad@inbox.ru/
Fixes: 8356c423e6 ("btrfs-progs: receive: implement FILEATTR command")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2022-11-24 17:29:12 +01:00
..
balance.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
commands.h btrfs-progs: unify naming of subvolume command definitions 2022-10-25 20:45:00 +02:00
device.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
filesystem-du.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
filesystem-usage.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
filesystem-usage.h btrfs-progs: fi usage: unify naming of device and chunk info variables 2022-10-11 09:08:08 +02:00
filesystem.c Revert "btrfs-progs: resize: return error value from check_resize_args()" 2022-11-24 17:26:24 +01:00
inspect-dump-super.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
inspect-dump-tree.c btrfs-progs: replace strerror(errno) with %m in printf formats 2022-10-26 09:46:22 +02:00
inspect-tree-stats.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
inspect.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
property.c btrfs-progs: property: use pr_verbose for messages 2022-10-11 09:08:11 +02:00
props.h btrfs-progs: prop set: add force parameter 2021-10-07 18:40:24 +02:00
qgroup.c btrfs-progs: qgroups: update help texts 2022-10-26 10:15:40 +02:00
qgroup.h btrfs-progs: move all private definitions to cmds/qgroup.c 2021-09-07 19:21:14 +02:00
quota.c btrfs-progs: quota: add -W option to rescan to wait without starting rescan 2022-10-25 21:12:24 +02:00
receive-dump.c btrfs-progs: receive: add support for fs-verity 2022-10-11 09:08:08 +02:00
receive-dump.h btrfs-progs: cmds: update include lists 2022-10-11 09:07:59 +02:00
receive.c btrfs-progs: receive: work around failure of fileattr commands 2022-11-24 17:29:12 +01:00
replace.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
rescue-chunk-recover.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
rescue-super-recover.c btrfs-progs: cmds: update include lists 2022-10-11 09:07:59 +02:00
rescue.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
rescue.h btrfs-progs: unify GPL header comments 2021-09-07 13:58:44 +02:00
restore.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
scrub.c btrfs-progs: cmds: use bool for status variables 2022-10-11 09:08:12 +02:00
send.c btrfs-progs: replace strerror(errno) with %m in printf formats 2022-10-26 09:46:22 +02:00
subvolume-list.c btrfs-progs: unify naming of subvolume command definitions 2022-10-25 20:45:00 +02:00
subvolume.c btrfs-progs: subvol: fix help text reference to subvolume 2022-10-26 10:15:40 +02:00