Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the DBUS to dynamically update protocols of export, changed from 3 to 3, 4, not in effect. #1128

Open
Haroldll opened this issue May 8, 2024 · 15 comments
Labels
Analyzing enhancement Need Info Need more information from the reporter

Comments

@Haroldll
Copy link

Haroldll commented May 8, 2024

My ganesha version is 6-dev.11.
Configured as:
EXPORT { Export_Id = 1; Path = /nfs; Protocols = 3; Access_Type = RW; Squash = Root_Squash; Pseudo = /nfs; FSAL { Name = VFS; } }
After starting ganesha, change the configuration to:
EXPORT { Export_Id = 1; Path = /nfs; Protocols = 3,4; Access_Type = RW; Squash = Root_Squash; Pseudo = /nfs; FSAL { Name = VFS; } }
Then use the command to modify the protocol to 3, 4, command is:
dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/ganesha.conf string:'EXPORT(Path=/nfs)'

method return time=1630442278.232412 sender=:1.273 -> destination=:1.278 serial=603 reply_serial=2
string "1 exports updated"

When I see this return value, I think the modification was successful, but when I use v4 mount, it says that the directory does not exist.
mount -t nfs -o vers=4 localhost:/nfs /mnt/nfs
mount.nfs: mounting localhost:/nfs failed, reason given by server: No such file or directory

v3 is ok.
Also, change from 4 to 3, 4 is normal,

@Haroldll
Copy link
Author

Haroldll commented May 8, 2024

The logs for updating export are as follows:

[dbus_heartbeat] gsh_export_update_export :EXPORT :INFO :Adding export from file: /etc/ganesha/ganesha.conf with EXPORT(Path=/nfs)
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:1): process block EXPORT link_mem = (nil)
[dbus_heartbeat] alloc_export :EXPORT :F_DBG :Allocated export 0x7fa5c40072e8
[dbus_heartbeat] alloc_export :RW LOCK :F_DBG :Init rwlock 0x7fa5c4007438 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/export_mgr.c:231
[dbus_heartbeat] export_init :EXPORT :F_DBG :Allocated export 0x7fa5c40072e8
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:1): do_block_init EXPORT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40074a0 name=Export_id type=CONFIG_UINT16
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073c8 name=Path type=CONFIG_PATH
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073d0 name=Pseudo type=CONFIG_PATH
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073e8 name=MaxRead type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073f0 name=MaxWrite type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073f8 name=PrefRead type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007400 name=PrefWrite type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007408 name=PrefReaddir type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007420 name=Filesystem_id type=CONFIG_FSID
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073d8 name=Tag type=CONFIG_STRING
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007410 name=MaxOffsetWrite type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007418 name=MaxOffsetRead type=CONFIG_UINT64
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007498 name=UseCookieVerifier type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007498 name=DisableReaddirPlus type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007498 name=Trust_Readdir_Negative_Cache type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007498 name=Disable_ACL type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007498 name=Security_Label type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=Access_Type type=CONFIG_ENUM
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c CONFIG_ENUM Access_Type mask=000001e0 def=00000000 value=00000000
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=Protocols type=CONFIG_LIST
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c CONFIG_LIST Protocols mask=00700000 def=00300000 value=00300000
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=Transports type=CONFIG_LIST
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c CONFIG_LIST Transports mask=07000000 def=03000000 value=03300000
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007470 name=Anonymous_uid type=CONFIG_ANON_ID
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007474 name=Anonymous_gid type=CONFIG_ANON_ID
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=SecType type=CONFIG_LIST
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c CONFIG_LIST SecType mask=0001f000 def=00003000 value=03303000
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=PrivilegedPort type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=Manage_Gids type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=Squash type=CONFIG_LIST
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c CONFIG_LIST Squash mask=00000007 def=00000002 value=03303002
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=NFS_Commit type=CONFIG_BOOLBIT
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c name=Delegations type=CONFIG_ENUM
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c400747c CONFIG_ENUM Delegations mask=30000000 def=00000000 value=03303002
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007478 name=Attr_Expiration_Time type=CONFIG_INT32
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c4007390 name=Client type=CONFIG_BLOCK
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40073b0 name=FSAL type=CONFIG_BLOCK
[dbus_heartbeat] export_display :EXPORT :M_DBG :DEFAULTS 0x7fa5c40072e8 Export 1 pseudo ((null)) with path ((null)) and tag ((null)) perms (options=03303002/00000000               ,     ,    ,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:1): do_block_load EXPORT
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c40074a0 name=Export_id type=CONFIG_UINT16
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c40073c8 name=Path type=CONFIG_PATH
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c40073d0 name=Pseudo type=CONFIG_PATH
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c400747c name=Access_Type type=CONFIG_ENUM
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c400747c CONFIG_ENUM Access_Type mask=000001e0 flags=000001e0 value=033031e2
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c400747c name=Protocols type=CONFIG_LIST
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c400747c CONFIG_LIST Protocols mask=00700000 flags=00300000 value=033031e2
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c400747c name=Squash type=CONFIG_LIST
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c400747c CONFIG_LIST Squash mask=00000007 flags=00000002 value=033031e2
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c40073b0 name=FSAL type=CONFIG_BLOCK
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): process block FSAL link_mem = 0x7fa5c40073b0
[dbus_heartbeat] fsal_init :CONFIG :F_DBG :Allocating args 0x7fa5c40073b0/0x7fa5c40074b0
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): do_block_init FSAL
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5c40074b0 name=Name type=CONFIG_STRING
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): do_block_load FSAL
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5c40074b0 name=Name type=CONFIG_STRING
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): commit FSAL
[dbus_heartbeat] get_gsh_export :RW LOCK :F_DBG :Got read lock on 0x7fa5e8c083a0 (&export_by_id.eid_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/export_mgr.c:293
[dbus_heartbeat] get_gsh_export :HT CACHE :DEBUG :export_mgr cache hit slot 1
[dbus_heartbeat] get_gsh_export :EXPORT :F_DBG :get export ref for id 1 /nfs, refcount = 2
[dbus_heartbeat] get_gsh_export :RW LOCK :F_DBG :Unlocked 0x7fa5e8c083a0 (&export_by_id.eid_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/export_mgr.c:326
[dbus_heartbeat] get_gsh_export :EXPORT :DEBUG :Found Export 0xd35508     1 pseudo (/nfs) with path (/nfs) and tag ((null)) perms (options=031031e2/007001e7 root_squash   , RWrw, 3--,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] lookup_fsal :FSAL :F_DBG :FSAL VFS refcount 2
[dbus_heartbeat] clean_export_paths :EXPORT :F_DBG :Cleaning paths for 1 fullpath /nfs pseudopath /nfs
[dbus_heartbeat] clean_export_paths :EXPORT :F_DBG :Final paths for 1 fullpath /nfs pseudopath /nfs
[dbus_heartbeat] update_export :FSAL :F_DBG :Updating export 0xd35e10
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): process block FSAL link_mem = 0x7fa5cbffdaf0
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): do_block_init FSAL
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5cbffdaf0 name=name type=CONFIG_NULL
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5cbffdc58 name=fsid_type type=CONFIG_TOKEN
[dbus_heartbeat] do_block_init :CONFIG :F_DBG :0x7fa5cbffdc5c name=async_hsm_restore type=CONFIG_BOOL
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): do_block_load FSAL
[dbus_heartbeat] do_block_load :CONFIG :F_DBG :0x7fa5cbffdaf0 name=name type=CONFIG_NULL
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:8): commit FSAL
[dbus_heartbeat] fsal_update_cfg_commit :EXPORT :DEBUG :Export 1 FSAL config update processed
[dbus_heartbeat] clear_op_context_export_impl :EXPORT :F_DBG :put export ref for id 1 /nfs, refcount = 1
[dbus_heartbeat] proc_block :CONFIG :F_DBG :Releasing block 0x7fa5c40073b0/0x7fa5c40074b0
[dbus_heartbeat] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:1): commit EXPORT
[dbus_heartbeat] update_export_commit :EXPORT :DEBUG :UPDATE EXPORT commit
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Got read lock on 0x7fa5c4007438 (&exp->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:934
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Got read lock on 0x7fa5e8c12d60 (&export_opt_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:941
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :EXPORT          (options=033031e2/007001e7 root_squash   , RWrw, 34-,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :EXPORT_DEFAULTS (options=00000000/00000000               ,     ,    ,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :default options (options=03303002/ffffffff root_squash   , ----, 34-, UDP, TCP, ----, No Manage_Gids, -- Deleg, anon_uid=    -2, anon_gid=    -2, expire=      60, none, sys)
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :Final options   (options=033031e2/ffffffff root_squash   , RWrw, 34-, UDP, TCP, ----, No Manage_Gids, -- Deleg, anon_uid=     0, anon_gid=     0, expire=       0, none, sys)
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Unlocked 0x7fa5e8c12d60 (&export_opt_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:991
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Unlocked 0x7fa5c4007438 (&exp->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:994
[dbus_heartbeat] export_commit_common :EXPORT :F_DBG :Processing 0x7fa5c40072e8
[dbus_heartbeat] get_gsh_export :RW LOCK :F_DBG :Got read lock on 0x7fa5e8c083a0 (&export_by_id.eid_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/export_mgr.c:293
[dbus_heartbeat] get_gsh_export :HT CACHE :DEBUG :export_mgr cache hit slot 1
[dbus_heartbeat] get_gsh_export :EXPORT :F_DBG :get export ref for id 1 /nfs, refcount = 2
[dbus_heartbeat] get_gsh_export :RW LOCK :F_DBG :Unlocked 0x7fa5e8c083a0 (&export_by_id.eid_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/export_mgr.c:326
[dbus_heartbeat] get_gsh_export :EXPORT :DEBUG :Found Export 0xd35508     1 pseudo (/nfs) with path (/nfs) and tag ((null)) perms (options=031031e2/007001e7 root_squash   , RWrw, 3--,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] export_commit_common :EXPORT :F_DBG :Updating 0xd35508
[dbus_heartbeat] export_commit_common :EXPORT :M_DBG :Old Client List
[dbus_heartbeat] LogExportClients :RW LOCK :F_DBG :Got read lock on 0xd35658 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:356
[dbus_heartbeat] LogExportClients :RW LOCK :F_DBG :Unlocked 0xd35658 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:371
[dbus_heartbeat] export_commit_common :EXPORT :M_DBG :New Client List
[dbus_heartbeat] LogExportClients :RW LOCK :F_DBG :Got read lock on 0x7fa5c4007438 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:356
[dbus_heartbeat] LogExportClients :RW LOCK :F_DBG :Unlocked 0x7fa5c4007438 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:371
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Got read lock on 0x7fa5c4007438 (&exp->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:934
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Got read lock on 0x7fa5e8c12d60 (&export_opt_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:941
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :EXPORT          (options=033031e2/007001e7 root_squash   , RWrw, 34-,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :EXPORT_DEFAULTS (options=00000000/00000000               ,     ,    ,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :default options (options=03303002/ffffffff root_squash   , ----, 34-, UDP, TCP, ----, No Manage_Gids, -- Deleg, anon_uid=    -2, anon_gid=    -2, expire=      60, none, sys)
[dbus_heartbeat] export_check_options :EXPORT :M_DBG :Final options   (options=033031e2/ffffffff root_squash   , RWrw, 34-, UDP, TCP, ----, No Manage_Gids, -- Deleg, anon_uid=     0, anon_gid=     0, expire=       0, none, sys)
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Unlocked 0x7fa5e8c12d60 (&export_opt_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:991
[dbus_heartbeat] export_check_options :RW LOCK :F_DBG :Unlocked 0x7fa5c4007438 (&exp->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:994
[dbus_heartbeat] export_commit_common :EXPORT :DEBUG :Export 1 NFSv4 changing from not mounted to can be mounted
[dbus_heartbeat] copy_gsh_export :RW LOCK :F_DBG :Got write lock on 0xd35658 (&dest->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:869
[dbus_heartbeat] gsh_refstr_release :EXPORT :F_DBG :Releasing refstr /nfs
[dbus_heartbeat] gsh_refstr_release :EXPORT :F_DBG :Releasing refstr /nfs
[dbus_heartbeat] copy_gsh_export :EXPORT :F_DBG :Original clients = (0xd355b0,0xd355b0) New clients = (0x7fa5c4007390,0x7fa5c4007390)
[dbus_heartbeat] copy_gsh_export :RW LOCK :F_DBG :Unlocked 0xd35658 (&dest->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:924
[dbus_heartbeat] export_commit_common :EXPORT :F_DBG :put export ref for id 1 /nfs, refcount = 1
[dbus_heartbeat] export_commit_common :CONFIG :INFO :Export 1 updated at pseudo (/nfs) with path (/nfs) and tag ((null)) perms (options=033031e2/007001e7 root_squash   , RWrw, 34-,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] export_commit_common :CONFIG :INFO :Export 1 has 0 defined clients
[dbus_heartbeat] export_display :EXPORT :M_DBG :RESULT 0x7fa5c40072e8 Export 1 pseudo (/nfs) with path (/nfs) and tag ((null)) perms (options=033031e2/007001e7 root_squash   , RWrw, 34-,               ,               ,         ,                ,                ,                )
[dbus_heartbeat] proc_block :CONFIG :F_DBG :Releasing block (nil)/0x7fa5c40072e8
[dbus_heartbeat] export_init :EXPORT :F_DBG :Releasing export 0x7fa5c40072e8
[dbus_heartbeat] export_init :EXPORT :F_DBG :put export ref for id 1 /nfs, refcount = 0
[dbus_heartbeat] gsh_refstr_release :EXPORT :F_DBG :Releasing refstr /nfs
[dbus_heartbeat] gsh_refstr_release :EXPORT :F_DBG :Releasing refstr /nfs
[dbus_heartbeat] free_export_resources :EXPORT :DEBUG :Free resources for export 0x7fa5c40072e8 id 1 path /nfs
[dbus_heartbeat] free_export_resources :EXPORT :DEBUG :Export root (nil)
[dbus_heartbeat] nfs_export_get_root_entry :RW LOCK :F_DBG :Got read lock on 0x7fa5c4007438 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:2824
[dbus_heartbeat] nfs_export_get_root_entry :RW LOCK :F_DBG :Unlocked 0x7fa5c4007438 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/exports.c:2831
[dbus_heartbeat] release_export :MDCACHE :INFO :Export root for export id 1 status No such file or directory
[dbus_heartbeat] free_export_resources :EXPORT :DEBUG :release_export complete
[dbus_heartbeat] free_export_resources :EXPORT :DEBUG :Goodbye export 0x7fa5c40072e8 path No Export pseudo No Export
[dbus_heartbeat] _put_gsh_export :RW LOCK :F_DBG :Destroy mutex 0x7fa5c4007438 (&export->exp_lock) at /root/rpmbuild/BUILD/nfs-ganesha-6-dev.11/support/export_mgr.c:748

@dang
Copy link
Contributor

dang commented May 8, 2024

Interesting. That dbus command isn't intended to reload the main ganesha.conf, but to load extra config snippits containing just export config, so it may not work correctly. If you are reloading the main ganesha.conf, you can send a SIGHUP to the ganesha process, and it will reload all it's config.

That said, there are two places that NFS version is configured: per export, like you have above, and in NFS_CORE_PARAMS. Is you do it in the core params, it will control which sockets are actually opened, and can only be done at startup. If the core params say only 3, for example, then the socket for NFSv4 isn't opened, and you can't connect on nfsv4 without restarting Ganesha.

@xiaods
Copy link

xiaods commented May 9, 2024

Interesting. That dbus command isn't intended to reload the main ganesha.conf, but to load extra config snippits containing just export config, so it may not work correctly. If you are reloading the main ganesha.conf, you can send a SIGHUP to the ganesha process, and it will reload all it's config.

That said, there are two places that NFS version is configured: per export, like you have above, and in NFS_CORE_PARAMS. Is you do it in the core params, it will control which sockets are actually opened, and can only be done at startup. If the core params say only 3, for example, then the socket for NFSv4 isn't opened, and you can't connect on nfsv4 without restarting Ganesha.

Is this a design convention?

@Haroldll
Copy link
Author

Haroldll commented May 9, 2024

That said, there are two places that NFS version is configured: per export, like you have above, and in NFS_CORE_PARAMS. Is you do it in the core params, it will control which sockets are actually opened, and can only be done at startup. If the core params say only 3, for example, then the socket for NFSv4 isn't opened, and you can't connect on nfsv4 without restarting Ganesha.

I have 3,4 configured in NFS_CORE_PARAMS, there is also a export that supports 3,4. Complete configuration:
NFS_CORE_PARAM {
NFS_Port = 2049;
MNT_Port = 32001;
NLM_Port = 32002;
Enable_NFSACL = true;
NFS_Protocols = 3,4;
}

EXPORT {
Export_Id = 1;
Path = /nfs;
Protocols = 3;
Access_Type = RW;
Squash = Root_Squash;
Pseudo = /nfs;
FSAL {
Name = VFS;
}
}

EXPORT {
Export_Id = 2;
Path = /nfs1;
Protocols = 3,4;
Access_Type = RW;
Squash = Root_Squash;
Pseudo = /nfs1;
FSAL {
Name = VFS;
}
}
In this case, dynamically modify the protocol of the /nfs directory to 3, 4. Do we need to reopen the v4 sockets in this configuration?

@dang
Copy link
Contributor

dang commented May 9, 2024

In this case, dynamically modify the protocol of the /nfs directory to 3, 4. Do we need to reopen the v4 sockets in this configuration?

No, the sockets are opened based on the Protocols setting in NFS_CORE_PARAMS, which is 3,4, so the sockets should be open. Could you try reconfiguring via SIGHUP instead of DBUS, and see if that works?

@dang
Copy link
Contributor

dang commented May 9, 2024

Is this a design convention?

Sorry, is which a convention? There were several distinct things in those paragraphs.

@ffilz
Copy link
Member

ffilz commented May 9, 2024

I see what the issue is. While the DBUS update export does do some of the update, it doesn't do the PseudoFS swizzling that an update caused by SIGHUP does.

This code:

` generation = get_config_generation(in_config);

    /* Prune the pseudofs of all exports that will be unexported (defunct)
     * as well as any descendant exports. Then unexport all defunct exports.
     * Finally remount all the exports that were unmounted. If that fails,
     * create_pseudofs() will LogFatal and abort.
     */
    prune_pseudofs_subtree(NULL, generation, false);
    prune_defunct_exports(generation);
    create_pseudofs();

`
Is missing from gsh_export_update_export

I think it would work to just drop that in after the call to report_config_errors, but not sure.

The DBUS interface has received less effort than the SIGHUP because it is harder to use in some environments.

@Haroldll
Copy link
Author

No, the sockets are opened based on the Protocols setting in NFS_CORE_PARAMS, which is 3,4, so the sockets should be open. Could you try reconfiguring via SIGHUP instead of DBUS, and see if that works?

After I modified the protocol to 3, 4, using the command: kill -HUP $(pidof ganesha.nfsd)
This didn't work properly, still can't use v4 mounts.

logs:

ganesha.nfsd-1152399[sigmgr] sigmgr_thread :MAIN :EVENT :SIGHUP_HANDLER: Received SIGHUP.... initiating export list reload
ganesha.nfsd-1152399[sigmgr] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:33): process block LOG link_mem = 0x7fe2df3bf330
ganesha.nfsd-1152399[sigmgr] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:33): do_block_init LOG
ganesha.nfsd-1152399[sigmgr] do_block_init :CONFIG :F_DBG :0x7fe2df3bf350 name=Default_Log_Level type=CONFIG_TOKEN
ganesha.nfsd-1152399[sigmgr] do_block_init :CONFIG :F_DBG :0x7fe2df3bf354 name=RPC_Debug_Flags type=CONFIG_UINT32
ganesha.nfsd-1152399[sigmgr] do_block_init :CONFIG :F_DBG :0x7fe2df3bf330 name=Facility type=CONFIG_BLOCK
ganesha.nfsd-1152399[sigmgr] do_block_init :CONFIG :F_DBG :0x7fe2df3bf340 name=Format type=CONFIG_BLOCK
ganesha.nfsd-1152399[sigmgr] do_block_init :CONFIG :F_DBG :0x7fe2df3bf348 name=Components type=CONFIG_BLOCK
ganesha.nfsd-1152399[sigmgr] do_block_init :CONFIG :F_DBG :0x7fe2df3bf358 name=Display_UTC_Timestamp type=CONFIG_BOOL
ganesha.nfsd-1152399[sigmgr] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:33): do_block_load LOG
ganesha.nfsd-1152399[sigmgr] do_block_load :CONFIG :F_DBG :0x7fe2df3bf348 name=Components type=CONFIG_BLOCK
ganesha.nfsd-1152399[sigmgr] do_block_load :CONFIG :INFO :Block COMPONENTS is empty
ganesha.nfsd-1152399[sigmgr] proc_block :CONFIG :F_DBG :------ At (/etc/ganesha/ganesha.conf:33): commit LOG

@Haroldll
Copy link
Author

I think it would work to just drop that in after the call to report_config_errors, but not sure.

In the gsh_export_update_export function, I tried to add after report_config_errors:

	generation = get_config_generation(config_struct);
	prune_pseudofs_subtree(NULL, generation, false);
	prune_defunct_exports(generation);
	create_pseudofs();

But it's still not working.

Also, SIGHUP is not working, and for now I can only get it to work by restarting the process.

@ffilz
Copy link
Member

ffilz commented May 10, 2024

What version of Ganesha are you using?

@ffilz ffilz added Analyzing Need Info Need more information from the reporter labels May 10, 2024
@Haroldll
Copy link
Author

6-dev.11.

@izxl007
Copy link

izxl007 commented May 22, 2024

static inline bool export_can_be_mounted(struct gsh_export *exp)
{
uint32_t options = export_check_options(exp);

return (options & EXPORT_OPTION_NFSV4) != 0
       && exp->cfg_pseudopath != NULL
       && exp->export_id != 0
       && exp->cfg_pseudopath[1] != '\0';

}

can delete codition "options & EXPORT_OPTION_NFSV4) != 0" ?

@ffilz
Copy link
Member

ffilz commented May 22, 2024

That check verifies that the export has been configured to be exported NFSv4

@izxl007
Copy link

izxl007 commented May 23, 2024

Removing this condition can fix this issue, but I don't know of any other effects.

@xiaods
Copy link

xiaods commented May 23, 2024

My ganesha version is 6-dev.11. Configured as: EXPORT { Export_Id = 1; Path = /nfs; Protocols = 3; Access_Type = RW; Squash = Root_Squash; Pseudo = /nfs; FSAL { Name = VFS; } } After starting ganesha, change the configuration to: EXPORT { Export_Id = 1; Path = /nfs; Protocols = 3,4; Access_Type = RW; Squash = Root_Squash; Pseudo = /nfs; FSAL { Name = VFS; } } Then use the command to modify the protocol to 3, 4, command is: dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.UpdateExport string:/etc/ganesha/ganesha.conf string:'EXPORT(Path=/nfs)'

method return time=1630442278.232412 sender=:1.273 -> destination=:1.278 serial=603 reply_serial=2 string "1 exports updated"

When I see this return value, I think the modification was successful, but when I use v4 mount, it says that the directory does not exist. mount -t nfs -o vers=4 localhost:/nfs /mnt/nfs mount.nfs: mounting localhost:/nfs failed, reason given by server: No such file or directory

v3 is ok. Also, change from 4 to 3, 4 is normal,

https://github.com/nfs-ganesha/nfs-ganesha/wiki/DBusExports

According to the official documentation, D-Bus can only dynamically update exports and cannot change the protocol version of NFS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analyzing enhancement Need Info Need more information from the reporter
Projects
None yet
Development

No branches or pull requests

5 participants