diff --git a/main.c b/main.c index cf209e2..0945c45 100644 --- a/main.c +++ b/main.c @@ -3484,7 +3484,7 @@ ovl_setattr (fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, stru switch (mode & S_IFMT) { case S_IFREG: - cleaned_up_fd = fd = TEMP_FAILURE_RETRY (openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK|O_WRONLY)); + cleaned_up_fd = fd = TEMP_FAILURE_RETRY (openat (dirfd, node->path, O_NOFOLLOW|O_NONBLOCK|(to_set & FUSE_SET_ATTR_SIZE ? O_WRONLY : 0))); if (fd < 0) { fuse_reply_err (req, errno);