main: reserve sfs.f_namemax for whiteout prefix

redure the reported sfs.f_namemax by the maximum length that can be
added for whiteout files.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-10-04 16:45:01 +02:00
parent d34833dfb3
commit 4725e0ba66
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

4
main.c
View File

@ -145,6 +145,7 @@ open_by_handle_at (int mount_fd, struct file_handle *handle, int flags)
#define PRIVILEGED_OPAQUE_XATTR "trusted.overlay.opaque" #define PRIVILEGED_OPAQUE_XATTR "trusted.overlay.opaque"
#define PRIVILEGED_ORIGIN_XATTR "trusted.overlay.origin" #define PRIVILEGED_ORIGIN_XATTR "trusted.overlay.origin"
#define OPAQUE_WHITEOUT ".wh..wh..opq" #define OPAQUE_WHITEOUT ".wh..wh..opq"
#define WHITEOUT_MAX_LEN (sizeof (OPAQUE_WHITEOUT))
#if !defined FICLONE && defined __linux__ #if !defined FICLONE && defined __linux__
# define FICLONE _IOW (0x94, 9, int) # define FICLONE _IOW (0x94, 9, int)
@ -4440,6 +4441,9 @@ ovl_statfs (fuse_req_t req, fuse_ino_t ino)
fuse_reply_err (req, errno); fuse_reply_err (req, errno);
return; return;
} }
sfs.f_namemax -= WHITEOUT_MAX_LEN;
fuse_reply_statfs (req, &sfs); fuse_reply_statfs (req, &sfs);
} }