diff options
| author | Bernd Schubert <bschubert@ddn.com> | 2024-12-16 22:14:07 +0100 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2025-03-31 14:59:27 +0200 |
| commit | 27992ef80770d61a57f6c3a551735b08cefdffa3 (patch) | |
| tree | 50e66236fc0e87e387dc44ba08114a0c266e0bf8 /fs/fuse/dev.c | |
| parent | 2412085da370836945c2daa61c5cee38dd979e0d (diff) | |
fuse: Increase FUSE_NAME_MAX to PATH_MAX
Our file system has a translation capability for S3-to-posix.
The current value of 1kiB is enough to cover S3 keys, but
does not allow encoding of %xx escape characters.
The limit is increased to (PATH_MAX - 1), as we need
3 x 1024 and that is close to PATH_MAX (4kB) already.
-1 is used as the terminating null is not included in the
length calculation.
Testing large file names was hard with libfuse/example file systems,
so I created a new memfs that does not have a 255 file name length
limitation.
https://github.com/libfuse/libfuse/pull/1077
The connection is initialized with FUSE_NAME_LOW_MAX, which
is set to the previous value of FUSE_NAME_MAX of 1024. With
FUSE_MIN_READ_BUFFER of 8192 that is enough for two file names
+ fuse headers.
When FUSE_INIT reply sets max_pages to a value > 1 we know
that fuse daemon supports request buffers of at least 2 pages
(+ header) and can therefore hold 2 x PATH_MAX file names - operations
like rename or link that need two file names are no issue then.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev.c')
| -rw-r--r-- | fs/fuse/dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 45d15db38787..696ab0403120 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1657,7 +1657,7 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size, goto err; err = -ENAMETOOLONG; - if (outarg.namelen > FUSE_NAME_MAX) + if (outarg.namelen > fc->name_max) goto err; err = -EINVAL; @@ -1706,7 +1706,7 @@ static int fuse_notify_delete(struct fuse_conn *fc, unsigned int size, goto err; err = -ENAMETOOLONG; - if (outarg.namelen > FUSE_NAME_MAX) + if (outarg.namelen > fc->name_max) goto err; err = -EINVAL; |
