btrfs-progs: receive: make receive fall back on EPERM

For non-root usage, receive can't write compressed data and will get
EPERM, but falling back to writing uncompressed data may work and allows
receive as a normal user, which is safer.

Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
This commit is contained in:
Sweet Tea Dorminy 2024-03-21 15:17:17 -04:00
parent 682f676eb3
commit ea2c8e61a1
1 changed files with 1 additions and 1 deletions

View File

@ -1285,7 +1285,7 @@ static int process_encoded_write(const char *path, const void *data, u64 offset,
if (ret >= 0)
return 0;
/* Fall back for these errors, fail hard for anything else. */
if (errno != ENOSPC && errno != ENOTTY && errno != EINVAL) {
if (errno != ENOSPC && errno != ENOTTY && errno != EINVAL && errno != EPERM) {
ret = -errno;
error("encoded_write: writing to %s failed: %m", path);
return ret;