323 Commits

Author SHA1 Message Date
Giuseppe Scrivano
d40ac752b4
Merge pull request #14 from giuseppe/honor-overlay-origin-xattr
fuse-overlayfs: honor trusted.overlay.origin
2018-08-07 08:26:53 +02:00
Giuseppe Scrivano
b3898da66d
overlay: honor trusted.overlay.origin
While fuse-overlayfs doesn't set this xattr, ensure that we honor it
when it exists so that we report the correct st_ino on lower layers
that were created using the kernel implementation.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-08-01 13:54:08 +02:00
Giuseppe Scrivano
78f00d6449
setxattr: do not allow to set trusted.overlay.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-08-01 13:51:18 +02:00
Giuseppe Scrivano
21cb0e199d
read_dirs: always initialize l->next to NULL
Resolve a segfault when using multiple lower layers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-08-01 13:51:18 +02:00
Giuseppe Scrivano
1dadd3738f
main: improve errors logging
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-08-01 10:29:24 +02:00
Giuseppe Scrivano
71a8ad3175 fuse-overlayfs: try RENAME_EXCHANGE if the destination is a whiteout
if we are trying to move over an existing whiteout, try a rename2(...,
RENAME_EXCHANGE) first, so in one atomic operation we get both the
file renamed and the whiteout created in the old source.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-23 22:11:56 +02:00
Giuseppe Scrivano
3c0e4fac10
main: define RENAME_WHITEOUT if the definition is missing
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 13:40:50 +02:00
Giuseppe Scrivano
a5431eda02
main: remove include for unused file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 13:40:50 +02:00
Giuseppe Scrivano
552afbf2db fuse-overlayfs: mountpoint is the last argument passed
Consider the mountpoint to be the last argument passed, so that
fuse-overlayfs can be used as a mount helper.

This enables to run the github.com/amir73il/unionmount-testsuite
testsuite on fuse-overlayfs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-20 12:36:12 +02:00
Giuseppe Scrivano
24dd39ee72
fuse-overlayfs: fix order of lower layers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-19 09:23:21 +02:00
Giuseppe Scrivano
5b29022bd3
fuse-overlayfs: honor opaque directories
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-15 21:59:09 +02:00
Giuseppe Scrivano
d55cd97b73
fuse-overlayfs: propagate errors from readdir(3)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-15 19:30:49 +02:00
Giuseppe Scrivano
cc18f5ce18
fuse-overlayfs: rename uses a .wh. style whiteout
during a rename, use a .wh. style whiteout for the destination, so
that if the rename fails we don't make visible files from the lower
layers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-15 16:30:04 +02:00
Giuseppe Scrivano
e908a68156
fuse-overlayfs: remove duplicate variable in ovl_rename_direct
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-15 14:43:21 +02:00
Giuseppe Scrivano
b3f454183f
fuse-overlayfs: split ovl_rename in two functions
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-15 14:30:26 +02:00
Giuseppe Scrivano
04be2fced2
fuse-overlayfs: error out if redirect_dir is specified
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 14:15:03 +02:00
Giuseppe Scrivano
8b54d466e1
fuse-overlayfs: name the xattr origin not redirect
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 12:54:09 +02:00
Giuseppe Scrivano
358873e18b
fuse-overlayfs: do not allow to overwrite user.fuseoverlayfs xattrs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 12:42:49 +02:00
Giuseppe Scrivano
6e7b5d70fd
fuse-overlayfs: reload the dir before checking for EXDEV
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
e0ba188721
fuse-overlayfs: fix xattrs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
85d1a08cf2
fuse-overlayfs: support also mv to empty directory with whiteouts
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
0cc1b77696
fuse-overlayfs: hide directories recursively on a rename
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
b054b9a191
fuse-overlayfs: allow copy of a dir over an existing in the lower layers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
86f98b4c91
fuse-overlays: do not uncover removed directories from lower dirs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
f58a9c452e
fuse-overlayfs: skip whiteouts when comparing hardlinks during a rename
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
382b0d8e0c
fuse-overlayfs: create hard link in the workdir first
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
c851b9bfda
fuse-overlayfs: stop lookup on the first file found
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
81ecc7ea77
fuse-overlayfs: check if it is a whiteout before raising EEXIST
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
9c5acf4bf2
fuse-overlayfs: attempt to delete node whiteout first
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
4d34e45e37
fuse-overlayfs: implement mknod
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
b8f90ec1f6
fuse-overlayfs: mkdir creates the directory in the workdir first
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
996f297f9d
rmdir: catch ENOTEMPTY also when deleting a dir from a lower layer
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
616119093a
fuse-overlayfs: use renameat2(RENAME_WHITEOUT) when possible
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 00:03:34 +02:00
Giuseppe Scrivano
81c939f350
fuse-overlayfs: attempt to create mknod whiteout before attempting the .wh. fallback
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-11 16:57:59 +02:00
Giuseppe Scrivano
0d02ef15ce
fuse-overlayfs: check if it is a whiteout also when doing a lookup
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-11 16:20:51 +02:00
Giuseppe Scrivano
dbf5732c75
fuse-overlayfs: refactor code to delete a whiteout
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-11 12:37:48 +02:00
Giuseppe Scrivano
4dd791a734
fuse-overlayfs: refactor code to create a whiteout
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-11 11:10:29 +02:00
Giuseppe Scrivano
d8e9ee1299
fuse-overlayfs: shift uid/gid from FUSE ctx
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-11 10:27:58 +02:00
Giuseppe Scrivano
3c4027da81
open: create the new file in the working directory first
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-11 10:12:01 +02:00
Giuseppe Scrivano
8ba49ca75a
fuse-overlayfs: force default_permissions,allow_other
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-10 17:06:23 +02:00
Giuseppe Scrivano
b78f52f24b
fuse-overlayfs: on link(2) set the redirect link from the source
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 20:42:14 +02:00
Giuseppe Scrivano
5c3e2c330b
fuse-overlayfs: change cfs_ prefix again
as the project was renamed to fuse-overlayfs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 20:20:38 +02:00
Giuseppe Scrivano
7afb2f6a76
fuse-overlayfs: change option names to uidmapping and gidmapping
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 18:25:09 +02:00
Giuseppe Scrivano
c8c9a4aa2c
rename to fuse-overlayfs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 18:23:19 +02:00
Giuseppe Scrivano
4db566b76a
containerfs: retry syscalls that might be interrupted
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 14:23:50 +02:00
Giuseppe Scrivano
f7f9f8b44a
containerfs: change prefix lo_ to cfs_
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 12:05:19 +02:00
Giuseppe Scrivano
d7f52737d3
containerfs: fix fd leak
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 11:55:47 +02:00
Giuseppe Scrivano
003d569b74
containerfs: rename rmfrom to hidden_dirfd
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 10:48:19 +02:00
Giuseppe Scrivano
8dfeb42b06
containerfs: make low a bool
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 10:47:15 +02:00
Giuseppe Scrivano
4169157e92
containerfs: drop unused root_lower member
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-09 10:38:32 +02:00