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:
parent
682f676eb3
commit
ea2c8e61a1
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue