Message ID | 41f3e3f92372f48037c7cee18af808d4cc5352c5.1605723745.git.osandov@osandov.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: implement send/receive of compressed extents without decompressing | expand |
diff --git a/cmds/receive.c b/cmds/receive.c index 2aaba3ff..2c56cea6 100644 --- a/cmds/receive.c +++ b/cmds/receive.c @@ -654,7 +654,11 @@ static int open_inode_for_write(struct btrfs_receive *rctx, const char *path) rctx->write_fd = -1; } - rctx->write_fd = open(path, O_RDWR); + /* + * When opening with O_ALLOW_ENCODED, O_CLOEXEC must also be specified. + * We might as well always use it even though we don't exec anything. + */ + rctx->write_fd = open(path, O_RDWR | O_CLOEXEC); if (rctx->write_fd < 0) { ret = -errno; error("cannot open %s: %m", path);