mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
On the return path from F_RDAHEAD and F_READAHEAD fcntls, do not
unlock Giant twice. While there, bring conditions in the do/while loops closer to style, that also makes the lines fit into 80 columns. Reported and tested by: dougb
This commit is contained in:
parent
086f6e0cc7
commit
080136212f
1 changed files with 3 additions and 2 deletions
|
|
@ -718,14 +718,15 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
|
|||
do {
|
||||
new = old = fp->f_flag;
|
||||
new |= FRDAHEAD;
|
||||
} while (atomic_cmpset_rel_int(&fp->f_flag, old, new) == 0);
|
||||
} while (!atomic_cmpset_rel_int(&fp->f_flag, old, new));
|
||||
readahead_vnlock_fail:
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
vfslocked = 0;
|
||||
} else {
|
||||
do {
|
||||
new = old = fp->f_flag;
|
||||
new &= ~FRDAHEAD;
|
||||
} while (atomic_cmpset_rel_int(&fp->f_flag, old, new) == 0);
|
||||
} while (!atomic_cmpset_rel_int(&fp->f_flag, old, new));
|
||||
}
|
||||
fdrop(fp, td);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue