mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-26 09:54:22 +03:00
libshare: nfs: retry flock() when interrupted
Reviewed-by: Don Brady <don.brady@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12067
This commit is contained in:
parent
bdf6464c6c
commit
f50697f95b
@ -50,7 +50,9 @@ nfs_exports_lock(const char *name)
|
||||
return (err);
|
||||
}
|
||||
|
||||
if (flock(nfs_lock_fd, LOCK_EX) != 0) {
|
||||
while ((err = flock(nfs_lock_fd, LOCK_EX)) != 0 && errno == EINTR)
|
||||
;
|
||||
if (err != 0) {
|
||||
err = errno;
|
||||
fprintf(stderr, "failed to lock %s: %s\n", name, strerror(err));
|
||||
(void) close(nfs_lock_fd);
|
||||
|
Loading…
Reference in New Issue
Block a user