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:
Giuseppe Scrivano 2022-08-24 15:09:32 +02:00
parent 0448402ab5
commit 1746aef29c
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
2 changed files with 7 additions and 1 deletions

View File

@ -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
View File

@ -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");