Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/lib/libperfuse Pull up following revision(s) (requested b...
details: https://anonhg.NetBSD.org/src/rev/34138a346ff2
branches: netbsd-8
changeset: 453772:34138a346ff2
user: martin <martin%NetBSD.org@localhost>
date: Tue Aug 13 14:27:22 2019 +0000
description:
Pull up following revision(s) (requested by manu in ticket #1335):
lib/libperfuse/ops.c: revision 1.87
Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.
A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.
However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.
diffstat:
lib/libperfuse/ops.c | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
diffs (37 lines):
diff -r b31bb28f1fa2 -r 34138a346ff2 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c Mon Aug 12 17:20:03 2019 +0000
+++ b/lib/libperfuse/ops.c Tue Aug 13 14:27:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.c,v 1.84.8.1 2019/02/10 13:40:41 martin Exp $ */
+/* $NetBSD: ops.c,v 1.84.8.2 2019/08/13 14:27:22 martin Exp $ */
/*-
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2976,24 +2976,15 @@
* expect one. E.g.: if we provide none, GlusterFS logs an error
* "0-glusterfs-fuse: xl is NULL"
*
- * There is one exception with directories where filehandle
- * is not included, because libfuse uses different filehandle
- * in opendir/releasedir/readdir/fsyncdir compared to other
- * operations. Who locks a directory anyway?
- *
* We need the read file handle if the file is open read only,
* in order to support shared locks on read-only files.
* NB: The kernel always sends advlock for read-only
* files at exit time when the process used lock, see
* sys_exit -> exit1 -> fd_free -> fd_close -> VOP_ADVLOCK
*/
- if (!PN_ISDIR(opc)) {
- if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
- error = EBADF;
- goto out;
- }
- } else {
- fh = FUSE_UNKNOWN_FH;
+ if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
+ error = EBADF;
+ goto out;
}
ps = puffs_getspecific(pu);
Home |
Main Index |
Thread Index |
Old Index