mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
fd: use seqc_read_notmodify when translating fds
This commit is contained in:
parent
20ac5cda96
commit
71bd18d373
1 changed files with 3 additions and 7 deletions
|
|
@ -2921,9 +2921,7 @@ fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsear
|
|||
fdt = fdp->fd_files;
|
||||
if (__predict_false((u_int)fd >= fdt->fdt_nfiles))
|
||||
return (EBADF);
|
||||
seq = seqc_read_any(fd_seqc(fdt, fd));
|
||||
if (__predict_false(seqc_in_modify(seq)))
|
||||
return (EAGAIN);
|
||||
seq = seqc_read_notmodify(fd_seqc(fdt, fd));
|
||||
fde = &fdt->fdt_ofiles[fd];
|
||||
haverights = cap_rights_fde_inline(fde);
|
||||
fp = fde->fde_file;
|
||||
|
|
@ -3032,7 +3030,7 @@ fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
|
|||
*/
|
||||
for (;;) {
|
||||
#ifdef CAPABILITIES
|
||||
seq = seqc_read(fd_seqc(fdt, fd));
|
||||
seq = seqc_read_notmodify(fd_seqc(fdt, fd));
|
||||
fde = &fdt->fdt_ofiles[fd];
|
||||
haverights = *cap_rights_fde_inline(fde);
|
||||
fp = fde->fde_file;
|
||||
|
|
@ -3105,9 +3103,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp,
|
|||
if (__predict_false((u_int)fd >= fdt->fdt_nfiles))
|
||||
return (EBADF);
|
||||
#ifdef CAPABILITIES
|
||||
seq = seqc_read_any(fd_seqc(fdt, fd));
|
||||
if (__predict_false(seqc_in_modify(seq)))
|
||||
goto out_fallback;
|
||||
seq = seqc_read_notmodify(fd_seqc(fdt, fd));
|
||||
fde = &fdt->fdt_ofiles[fd];
|
||||
haverights = cap_rights_fde_inline(fde);
|
||||
fp = fde->fde_file;
|
||||
|
|
|
|||
Loading…
Reference in a new issue