Change in ...nfs-ganesha[next]: Rename struct attrlist to more specific name
by Matthew DeVore (GerritHub)
Matthew DeVore has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503594 )
Change subject: Rename struct attrlist to more specific name
......................................................................
Rename struct attrlist to more specific name
struct attrlist already exists in the macOS syscall API, so the naming
of this struct is problematic for any potential porting efforts.
Rename the struct to not clash with the macOS struct of the same name.
See this site or the getattrlist(2) man page on a macOS system:
https://developer.apple.com/library/archive/documentation/System/Conceptu...
Change-Id: Ifda7f5df2f99856aeb33b3df045773d32a590001
Signed-off-by: Matthew DeVore <matvore(a)google.com>
---
M src/FSAL/FSAL_CEPH/export.c
M src/FSAL/FSAL_CEPH/handle.c
M src/FSAL/FSAL_CEPH/internal.c
M src/FSAL/FSAL_CEPH/internal.h
M src/FSAL/FSAL_GLUSTER/export.c
M src/FSAL/FSAL_GLUSTER/gluster_internal.c
M src/FSAL/FSAL_GLUSTER/gluster_internal.h
M src/FSAL/FSAL_GLUSTER/handle.c
M src/FSAL/FSAL_GPFS/file.c
M src/FSAL/FSAL_GPFS/fsal_attrs.c
M src/FSAL/FSAL_GPFS/fsal_convert.c
M src/FSAL/FSAL_GPFS/fsal_create.c
M src/FSAL/FSAL_GPFS/fsal_fileop.c
M src/FSAL/FSAL_GPFS/fsal_internal.h
M src/FSAL/FSAL_GPFS/fsal_lookup.c
M src/FSAL/FSAL_GPFS/fsal_symlinks.c
M src/FSAL/FSAL_GPFS/fsal_up.c
M src/FSAL/FSAL_GPFS/gpfs_methods.h
M src/FSAL/FSAL_GPFS/handle.c
M src/FSAL/FSAL_LIZARDFS/export.c
M src/FSAL/FSAL_LIZARDFS/handle.c
M src/FSAL/FSAL_MEM/mem_handle.c
M src/FSAL/FSAL_MEM/mem_int.h
M src/FSAL/FSAL_MEM/mem_up.c
M src/FSAL/FSAL_PROXY_V3/main.c
M src/FSAL/FSAL_PROXY_V3/proxyv3_fsal_methods.h
M src/FSAL/FSAL_PROXY_V3/utils.c
M src/FSAL/FSAL_PROXY_V4/handle.c
M src/FSAL/FSAL_PROXY_V4/proxyv4_fsal_methods.h
M src/FSAL/FSAL_PROXY_V4/xattrs.c
M src/FSAL/FSAL_PSEUDO/handle.c
M src/FSAL/FSAL_PSEUDO/pseudofs_methods.h
M src/FSAL/FSAL_RGW/export.c
M src/FSAL/FSAL_RGW/handle.c
M src/FSAL/FSAL_VFS/file.c
M src/FSAL/FSAL_VFS/handle.c
M src/FSAL/FSAL_VFS/panfs/attrs.c
M src/FSAL/FSAL_VFS/panfs/attrs.h
M src/FSAL/FSAL_VFS/panfs/handle.c
M src/FSAL/FSAL_VFS/subfsal_helpers.c
M src/FSAL/FSAL_VFS/vfs/attrs.c
M src/FSAL/FSAL_VFS/vfs/attrs.h
M src/FSAL/FSAL_VFS/vfs_methods.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_file.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_int.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_up.c
M src/FSAL/Stackable_FSALs/FSAL_NULL/file.c
M src/FSAL/Stackable_FSALs/FSAL_NULL/handle.c
M src/FSAL/Stackable_FSALs/FSAL_NULL/nullfs_methods.h
M src/FSAL/access_check.c
M src/FSAL/commonlib.c
M src/FSAL/default_methods.c
M src/FSAL/fsal_convert.c
M src/FSAL/fsal_helper.c
M src/FSAL_UP/fsal_up_async.c
M src/FSAL_UP/fsal_up_top.c
M src/Protocols/9P/9p_getattr.c
M src/Protocols/9P/9p_lcreate.c
M src/Protocols/9P/9p_mkdir.c
M src/Protocols/9P/9p_mknod.c
M src/Protocols/9P/9p_readdir.c
M src/Protocols/9P/9p_setattr.c
M src/Protocols/9P/9p_statfs.c
M src/Protocols/9P/9p_symlink.c
M src/Protocols/NFS/nfs3_create.c
M src/Protocols/NFS/nfs3_getattr.c
M src/Protocols/NFS/nfs3_lookup.c
M src/Protocols/NFS/nfs3_mkdir.c
M src/Protocols/NFS/nfs3_mknod.c
M src/Protocols/NFS/nfs3_read.c
M src/Protocols/NFS/nfs3_readdir.c
M src/Protocols/NFS/nfs3_readdirplus.c
M src/Protocols/NFS/nfs3_setattr.c
M src/Protocols/NFS/nfs3_symlink.c
M src/Protocols/NFS/nfs4_op_create.c
M src/Protocols/NFS/nfs4_op_getattr.c
M src/Protocols/NFS/nfs4_op_getfh.c
M src/Protocols/NFS/nfs4_op_nverify.c
M src/Protocols/NFS/nfs4_op_open.c
M src/Protocols/NFS/nfs4_op_read.c
M src/Protocols/NFS/nfs4_op_readdir.c
M src/Protocols/NFS/nfs4_op_setattr.c
M src/Protocols/NFS/nfs4_op_verify.c
M src/Protocols/NFS/nfs4_pseudo.c
M src/Protocols/NFS/nfs_proto_tools.c
M src/Protocols/NFSACL/nfsacl_getacl.c
M src/Protocols/NFSACL/nfsacl_setacl.c
M src/gtest/fsal_api/test_getattrs_latency.cc
M src/gtest/fsal_api/test_handle_to_key_latency.cc
M src/gtest/fsal_api/test_handle_to_wire_latency.cc
M src/gtest/fsal_api/test_link_latency.cc
M src/gtest/fsal_api/test_lock_op2_latency.cc
M src/gtest/fsal_api/test_mkdir_latency.cc
M src/gtest/fsal_api/test_mknode_latency.cc
M src/gtest/fsal_api/test_open2_latency.cc
M src/gtest/fsal_api/test_readdir_correctness.cc
M src/gtest/fsal_api/test_readdir_latency.cc
M src/gtest/fsal_api/test_readlink_latency.cc
M src/gtest/fsal_api/test_setattr2_latency.cc
M src/gtest/fsal_api/test_symlink_latency.cc
M src/gtest/gtest.hh
M src/gtest/test_ci_hash_dist1.cc
M src/include/FSAL/fsal_commonlib.h
M src/include/fsal.h
M src/include/fsal_api.h
M src/include/fsal_convert.h
M src/include/fsal_types.h
M src/include/fsal_up.h
M src/include/nfs23.h
M src/include/nfs_creds.h
M src/include/nfs_proto_tools.h
M src/support/nfs_creds.c
114 files changed, 566 insertions(+), 558 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/94/503594/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503594
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ifda7f5df2f99856aeb33b3df045773d32a590001
Gerrit-Change-Number: 503594
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew DeVore <matvore(a)google.com>
Gerrit-MessageType: newchange
4 years, 2 months
Change in ...nfs-ganesha[next]: ProxyV3: Issue last-chance GETATTR in READDIRPLUS.
by Solomon Boulos (GerritHub)
Solomon Boulos has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503510 )
Change subject: ProxyV3: Issue last-chance GETATTR in READDIRPLUS.
......................................................................
ProxyV3: Issue last-chance GETATTR in READDIRPLUS.
NetApp's .snapshot directories apparently return no attributes
for a READDIRPLUS request. It's easy enough to issue a last-chance
"try with GETATTR" to fill in the attributes.
I tested this by just always doing the last-chance path and verified
it on both cthon04, manual testing (of ls), and the repeated rsync
from my earlier patch. I have *not* tested this against a NetApp
filer, but expect leffler(a)google.com to do so.
Change-Id: Ia25a5d6b2b8966bad4f173c3d62f2e87a8b68adb
Signed-off-by: Solomon Boulos <boulos(a)google.com>
---
M src/FSAL/FSAL_PROXY_V3/main.c
1 file changed, 33 insertions(+), 15 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/10/503510/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503510
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Ia25a5d6b2b8966bad4f173c3d62f2e87a8b68adb
Gerrit-Change-Number: 503510
Gerrit-PatchSet: 1
Gerrit-Owner: Solomon Boulos <boulos(a)google.com>
Gerrit-MessageType: newchange
4 years, 2 months
Misuse of a union of locks
by matvore@comcast.net
Hi,
I've found a bug that only influences some platforms which manifests as a result of a union of two lock types in src/include/sal_data.h:
union {
/** Lock protecting state */
pthread_mutex_t st_lock;
/** Lock protecting export junctions */
pthread_rwlock_t jct_lock;
};
When I ran Ganesha on macOS with a MEM FSAL and tried to mount the share, I could see in the debug log that the same exact address was being treated as a jct_lock and then a st_lock:
$ grep 0x7feb0200a080 ~/ganesha.log
02/10/2020 17:02:28 : epoch 5f77bf94 : <snip> : ganesha.nfsd-95907[main] state_hdl_init :RW LOCK :F_DBG :Init rwlock 0x7feb0200a080 (&ostate->jct_lock) at /Users/matvore/ganesha/src/include/sal_functions.h:141
02/10/2020 17:02:28 : epoch 5f77bf94 : <snip> : ganesha.nfsd-95907[main] init_export_root :RW LOCK :F_DBG :Got write lock on 0x7feb0200a080 (&obj->state_hdl->jct_lock) at /Users/matvore/ganesha/src/support/exports.c:2595
02/10/2020 17:02:28 : epoch 5f77bf94 : <snip> : ganesha.nfsd-95907[main] init_export_root :RW LOCK :F_DBG :Unlocked 0x7feb0200a080 (&obj->state_hdl->jct_lock) at /Users/matvore/ganesha/src/support/exports.c:2605
02/10/2020 17:03:59 : epoch 5f77bf94 : <snip> : ganesha.nfsd-95907[svc_9] nfs4_op_getattr :RW LOCK :CRIT :Error 22, acquiring mutex 0x7feb0200a080 (&(obj)->state_hdl->st_lock) at /Users/matvore/ganesha/src/Protocols/NFS/nfs4_op_getattr.c:122
The last log message corresponds to EINVAL and is only printed for acquiring a pthread mutex (not a rwlock). I think what is happening is that the root directory of the filesystem is sometimes treated as a normal directory and sometimes as a junction. I noticed the following code "works" on Linux but prints 22 on the second line on macOS:
#include <pthread.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
union {
pthread_mutex_t mut;
pthread_rwlock_t rwl;
} foo;
memset((void *)&foo, 0, sizeof(foo));
printf("ok if 0: %d\n", pthread_rwlock_init(&foo.rwl, NULL));
printf("ok if 0: %d\n", pthread_mutex_lock(&foo.mut));
}
I will continue looking at this, but posting this now in case anyone has hints. I naively tried to remove the union and just treat the lock as a rwlock always (grabbing a write lock rather than a mutex lock), and this solved the EINVAL error+abort, but there may be something else wrong causing a deadlock, since I have experienced one when mounting, and I noticed the lock order changes based on the side of the union being used.
Thanks,
Matt
4 years, 2 months
Announce Push of V4-dev.36
by Frank Filz
Branch next
Tag:V4-dev.36
Merge Highlights
* grace: optimize takeip process to end grace early
* RADOS_KV: fix wrong string size of cidstr
* FSAL_CEPH: fix create handle return EINVAL
* config_parsing: deprecated directive in conf_yacc.y
Signed-off-by: Frank S. Filz <ffilzlnx(a)mindspring.com>
Contents:
1f91cef Frank S. Filz V4-dev.36
d88c2ef Kaleb S. KEITHLEY config_parsing: deprecated directive in
conf_yacc.y
101cfb8 Vicente Cheng FSAL_CEPH: fix create handle return EINVAL
5a05378 sepia-liu RADOS_KV: fix wrong string size of cidstr
fbdeb66 sepia-liu grace: optimize takeip process to end grace early
4 years, 2 months
Change in ...nfs-ganesha[next]: Add missing mutex initialization
by Matthew DeVore (GerritHub)
Matthew DeVore has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503498 )
Change subject: Add missing mutex initialization
......................................................................
Add missing mutex initialization
The mutex struct is 0-initialized implicitly by the call to gsh_calloc
earlier in this function. This is good enough to make it a functional
mutex by some pthread implementations, but this is not sufficient on at
least macOS. Add an explicit initialization.
Change-Id: I345b1640820fbc591e285dcf375a1832e74270ff
Signed-off-by: Matthew DeVore <matvore(a)google.com>
---
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_main.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/98/503498/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503498
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I345b1640820fbc591e285dcf375a1832e74270ff
Gerrit-Change-Number: 503498
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew DeVore <matvore(a)google.com>
Gerrit-MessageType: newchange
4 years, 2 months
Change in ...nfs-ganesha[next]: config_parsing: deprecated directive in conf_yacc.y
by Kaleb KEITHLEY (GerritHub)
Kaleb KEITHLEY has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503487 )
Change subject: config_parsing: deprecated directive in conf_yacc.y
......................................................................
config_parsing: deprecated directive in conf_yacc.y
Seen on Fedora f34/rawhide
...
Building parser with bison 3.7.2
...
... conf_yacc.y:21.1-12: warning: deprecated directive: ‘%pure-parser’, use ‘%define api.pure’
21 | %pure-parser^M
| ^~~~~~~~~~~~^M
| %define api.pure^M
...
Appears to work (not break) w/ bison 3.5 (on Fedora 32)
Change-Id: I080de3e1a8850569e7f232d7d151f4e6768891a9
Signed-off-by: Kaleb S. KEITHLEY <kkeithle(a)redhat.com>
---
M src/config_parsing/conf_yacc.y
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/87/503487/1
--
To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/503487
To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I080de3e1a8850569e7f232d7d151f4e6768891a9
Gerrit-Change-Number: 503487
Gerrit-PatchSet: 1
Gerrit-Owner: Kaleb KEITHLEY <kaleb(a)redhat.com>
Gerrit-MessageType: newchange
4 years, 2 months