diff options
| author | Cody Peter Mello <cody.mello@joyent.com> | 2016-08-12 18:53:06 +0000 |
|---|---|---|
| committer | Cody Peter Mello <cody.mello@joyent.com> | 2016-08-18 00:57:56 +0000 |
| commit | 2284cf450f099ce8441493d7c9f2c1cb0bbf474f (patch) | |
| tree | 0f4c5994c9e1ad3d95fa5558bb131540eb62c4fb /usr/src/uts/common/os/flock.c | |
| parent | fae673de1d84b263986f4dcdde53f15478ad664d (diff) | |
| download | illumos-joyent-2284cf450f099ce8441493d7c9f2c1cb0bbf474f.tar.gz | |
OS-5591 Double flock(3C) causes undue block
OS-5585 fcntl(F_OFD_GETLK) should return EINVAL on bad parameters
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/common/os/flock.c')
| -rw-r--r-- | usr/src/uts/common/os/flock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr/src/uts/common/os/flock.c b/usr/src/uts/common/os/flock.c index 884de65fe8..0f92f1a38d 100644 --- a/usr/src/uts/common/os/flock.c +++ b/usr/src/uts/common/os/flock.c @@ -523,10 +523,10 @@ ofdcleanlock(file_t *fp) * file descriptor the application loses its lock and does not know). * 2) Locks are not preserved across fork(2). * - * Because these locks are only assoiciated with a pid they are per-process. - * This is why any close will drop the lock and is also why once the process - * forks then the lock is no longer related to the new process. These locks can - * be considered as pid-ful. + * Because these locks are only associated with a PID, they are per-process. + * This is why any close will drop the lock and is also why, once the process + * forks, the lock is no longer related to the new process. These locks can + * be considered as PID-ful. * * See ofdlock() for the implementation of a similar but improved locking * scheme. @@ -1003,7 +1003,7 @@ flk_free_lock(lock_descriptor_t *lock) ASSERT(IS_DEAD(lock)); - if ((fp = lock->l_ofd) != NULL) + if ((fp = lock->l_ofd) != NULL && fp->f_filock == (struct filock *)lock) fp->f_filock = NULL; if (IS_REFERENCED(lock)) { |
