Skip to content

Commit

Permalink
Do not ignore O_TRUNC flag
Browse files Browse the repository at this point in the history
Instead of silently ignoring this return an error code. There is no reason why this
couldn't be supported, this is just a quick fix to avoid silent incorrect behavior.

We should also check if there are other open() flags that we may need to handle.

See also issue s3ql#182.
  • Loading branch information
Nikratio committed Jul 17, 2020
1 parent 57b59cc commit a6a1413
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ UNRELEASED CHANGES
* `s3qlctrl upload-meta` now works properly again (previously, only the first
invocation had an effect).

* The O_TRUNC flag of the open() syscall is no longer silently ignored, but
the open() call fails with ENOTSUP. A proper implementation will hopefully
follow soon.


2020-07-15, S3QL 3.5.0

Expand Down
4 changes: 4 additions & 0 deletions src/s3ql/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,10 @@ async def open(self, id_, flags, ctx):
and (self.failsafe or self.inodes[id_].locked)):
raise FUSEError(errno.EPERM)

if flags & os.O_TRUNC:
log.warning('open() with O_TRUNC is not yet supported.')
raise FUSEError(errno.ENOTSUP)

return pyfuse3.FileInfo(fh=id_, keep_cache=True)

async def access(self, id_, mode, ctx):
Expand Down

0 comments on commit a6a1413

Please sign in to comment.