mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-19 04:05:23 -04:00
main: handle -o volatile separately
so we can ignore invalid values for the option. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
0448402ab5
commit
1746aef29c
@ -102,6 +102,8 @@ struct ovl_data
|
||||
int squash_to_gid;
|
||||
int static_nlink;
|
||||
|
||||
int volatile_mode;
|
||||
|
||||
/* current uid/gid*/
|
||||
uid_t uid;
|
||||
uid_t gid;
|
||||
|
6
main.c
6
main.c
@ -231,7 +231,7 @@ static const struct fuse_opt ovl_opts[] = {
|
||||
{"static_nlink",
|
||||
offsetof (struct ovl_data, static_nlink), 1},
|
||||
{"volatile", /* native overlay supports "volatile" to mean fsync=0. */
|
||||
offsetof (struct ovl_data, fsync), 0},
|
||||
offsetof (struct ovl_data, volatile_mode), 1},
|
||||
{"noacl",
|
||||
offsetof (struct ovl_data, noacl), 1},
|
||||
FUSE_OPT_END
|
||||
@ -5555,6 +5555,7 @@ main (int argc, char *argv[])
|
||||
.timeout = 1000000000.0,
|
||||
.timeout_str = NULL,
|
||||
.writeback = 1,
|
||||
.volatile_mode = 0,
|
||||
};
|
||||
struct fuse_loop_config fuse_conf = {
|
||||
.clone_fd = 1,
|
||||
@ -5618,6 +5619,9 @@ main (int argc, char *argv[])
|
||||
set_limits ();
|
||||
check_can_mknod (&lo);
|
||||
|
||||
if (lo.volatile_mode)
|
||||
lo.fsync = 0;
|
||||
|
||||
if (lo.debug)
|
||||
{
|
||||
fprintf (stderr, "uid=%s\n", lo.uid_str ? : "unchanged");
|
||||
|
Loading…
x
Reference in New Issue
Block a user