FUSE never passes FUSE_SET_ATTR_ATIME_NOW without also passing
FUSE_SET_ATTR_ATIME. Since FUSE_SET_ATTR_ATIME_NOW was only checked if
FUSE_SET_ATTR_ATIME was not set, it would never be triggered.
Note that this is an *improvement*, not a *fix*, because FUSE always
passes the current time in st_atim whenever it sets
FUSE_SET_ATTR_ATIME_NOW. As a result, the previous code works properly,
but it does so differently from the way it was intended to.
(All of the above descriptions of st_atim handling also applies to
st_mtim.)
As specified in utimensat(2), *tv_nsec*, not *tv_sec*, should be set to
UTIME_NOW or UTIME_OMIT.
The way this bug manifests is that if utimensat() is called with
one of the timestamps set to UTIME_OMIT, fuse-overlayfs will
accidentally reset the timestamp to 1073741822, which is 2004-01-10
13:37:02 UTC.
Skips calculation of st_nlink for directories, which can be
expensive on higher latency file systems such as NFS.
Signed-off-by: David Hedberg <david.hedberg@gmail.com>
if a whiteout was created as part of a rename operation, mark the
directory content as not loaded so to avoid some optimizations when a
whiteout file must be deleted.
Closes: https://github.com/containers/fuse-overlayfs/issues/279
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
when device whiteouts are created (supported for unprivileged users in
newer Linux kernels) make sure the RENAME_NOREPLACE flag is dropped
when renaming the file on top of an existing whiteout.
Closes: https://github.com/containers/fuse-overlayfs/issues/273
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
on newer kernels unprivileged users can create whiteout devices. If
the whiteout device creation failed with EEXIST, check whether the
existing file is already a whiteout.
Closes: https://github.com/containers/fuse-overlayfs/issues/271
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if we are adding a new file to a directory, the parent directory must
be invalidated if it is in the middle of a opendir/releasedir
otherwise the added files won't be cached.
Closes: https://github.com/containers/fuse-overlayfs/issues/259
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if a file is delete and not accessible from the file system, but it is
still referenced, we must be able to open and use it.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
upstream Linux added an option "volatile" for overlay mounts that has
the same meaning as fsync=0 already supported by fuse-overlayfs.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
make sure the inodes are created with mode 0755 when using
xattr_permissions, otherwise the original permission could prevent
running on NFS. Requires Linux 5.9 for NFS with xattr support.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if the reference held by the directory is the last one, it would miss
to clean up the inode. Fix it by calling do_forget.
Closes: https://github.com/containers/fuse-overlayfs/issues/238
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
adding the .wh. prefix could cause the lookup to cross the f_namemax
limit and fail the lookup with ENAMETOOLONG. If the lookup fails with
ENAMETOOLONG then the whiteout file doesn't exist.
Closes: https://github.com/containers/fuse-overlayfs/issues/236
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
honor the specified flags to fchownat.
commit 50787d38278fa41c1b3f8167ccfe13ec83d9a063 introduced the
regression.
Closes: https://github.com/containers/fuse-overlayfs/issues/233
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
utils.c: file_exists_at: fallback to `fstatat` when `faccessat` fails with `EINVAL` (on musl).
.travis.yml: alpine test added.
main.c: reallocate path before appending.
Closes#174.
Signed-off-by: Max Goltzsche <max.goltzsche@gmail.com>
we were mistakenly using the overflow GID also for UIDs lookups. Not
a big issue as they usually have the same value.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>