Skip to content

Commit

Permalink
freebsd/libshare: nfs: make nfs_is_shared() thread-safe
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11886
  • Loading branch information
nabijaczleweli authored and behlendorf committed Apr 19, 2021
1 parent 8357bbf commit 62866fc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/libshare/os/freebsd/nfs.c
Expand Up @@ -259,14 +259,10 @@ nfs_disable_share(sa_share_impl_t impl_share)
ZFS_EXPORTS_LOCK, ZFS_EXPORTS_FILE, NULL, impl_share));
}

/*
* NOTE: This function returns a static buffer and thus is not thread-safe.
*/
static boolean_t
nfs_is_shared(sa_share_impl_t impl_share)
{
static char line[MAXLINESIZE];
char *s, last;
char *s, last, line[MAXLINESIZE];
size_t len;
char *mntpoint = impl_share->sa_mountpoint;
size_t mntlen = strlen(mntpoint);
Expand Down

0 comments on commit 62866fc

Please sign in to comment.