HomeFreeBSD

mount_nfs: Only create a mounttab file entry is nmount(2) succeeds

Description

mount_nfs: Only create a mounttab file entry is nmount(2) succeeds

mount_nfs creates entries in the mounttab file and umount removes
them. Entries in the mounttab file ae used by rpc.umntall to
notify the NFS server that NFSv3 entries need to be removed when
they have not been removed by umount.

Without this patch, an enty will be created in the mounttab file,
even if the nmount(2) syscall fails for the mount. This patch
modifies the code so that the mounttab entry is only created
after nmount(2) succeeds.

This change only affects NFSv3 and only affects how showmount
displays NFSv3 mounts.

(cherry picked from commit 7cab630ba4fb26bf85336a89d88721ed2315c46c)

Details

Provenance
rmacklemAuthored on May 28 2022, 10:48 PM
Parents
rG70efcaffa180: nfscl: Add a diagnostic printf() for a "should never happen" case
Branches
Unknown
Tags
Unknown