| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
it does and how, and add comments describing the data structures and
explaining how they are managed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, do not lock Giant conditionally when calling into the
filesystem module, remove the VFS_LOCK_GIANT() and related
macros. Stop handling buffers belonging to non-mpsafe filesystems.
The VFS_VERSION is bumped to indicate the interface change which does
not result in the interface signatures changes.
Conducted and reviewed by: attilio
Tested by: pho
|
|
|
|
|
|
| |
Submitted by: Jukka A. Ukkonen <jau iki fi>
PR: standards/169962
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Append '__' prefix to the tag of struct oflock, and put it under BSD
namespace. Structure is needed both by libc and kernel, thus cannot be
hidden under #ifdef _KERNEL.
Move a set of non-standard F_* and O_* constants into BSD namespace.
SUSv4 explicitely allows implemenation to pollute F_* and O_* names
after fcntl.h is included, but it costs us nothing to adhere
to the specification if exact POSIX compliance level is requested by
user code.
Change some spaces after #define to tabs.
Noted by and discussed with: bde
MFC after: 1 week
|
|
|
|
|
|
| |
Submitted by: pjd
Pointy hat to: kib
MFC after: 1 week
|
|
|
|
|
|
| |
PR: standards/169962
Submitted by: Jukka A. Ukkonen <jau iki fi>
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass only FEXEC (instead of FREAD|FEXEC) in fgetvp_exec. _fget has to check for
!FWRITE anyway and may as well know about FREAD.
Make _fget code a bit more readable by converting permission checking from if()
to switch(). Assert that correct permission flags are passed.
In collaboration with: kib
Approved by: trasz (mentor)
MFC after: 6 days
X-MFC: with r238220
|
|
|
|
|
|
|
|
|
|
|
| |
While here return EBADF for descriptors opened for writing (previously it was ETXTBSY).
Add fgetvp_exec function which performs appropriate checks.
PR: kern/169651
In collaboration with: kib
Approved by: trasz (mentor)
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
now fully encapsulates all accesses to f_offset, and extends f_offset
locking to other consumers that need it, in particular, to lseek() and
variants of getdirentries().
Ensure that on 32bit architectures f_offset, which is 64bit quantity,
always read and written under the mtxpool protection. This fixes
apparently easy to trigger race when parallel lseek()s or lseek() and
read/write could destroy file offset.
The already broken ABI emulations, including iBCS and SysV, are not
converted (yet).
Tested by: pho
No objections from: jhb
MFC after: 3 weeks
|
|
|
|
|
|
|
| |
can do when such a race occurs). This saves lock/unlock cycle for the filedesc
lock for every advisory unlock operation.
MFC after: 1 month
|
|
|
|
|
|
|
| |
it is done and why we don't return an error in such case.
Discussed with: kib
MFC after: 1 month
|
|
|
|
|
|
|
| |
close, because even if we had a race there is nothing to unlock.
Discussed with: kib
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
|
|
| |
holefully recovers from the "worse than useless" state.
Reported by: bde
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
|
| |
is called.
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
|
| |
- Fix white spaces.
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
| |
Reported by: bde
MFC after: 1 month
|
|
|
|
|
|
| |
fixed in r237065.
MFC after: 1 month
|
|
|
|
|
|
|
|
| |
on the underlying object and not on the capability itself.
Similar bug was fixed in r236853.
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
|
| |
being less than 0 instead of using cast-to-unsigned hack.
Today's commit was brought to you by the letters 'B', 'D' and 'E' :)
|
|
|
|
|
|
|
|
| |
the caller using finstall().
This saves us the filedesc lock/unlock cycle, fhold()/fdrop() cycle and closes
a race between finstall() and dupfdopen().
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
it a bit:
- We can assert that only ENODEV and ENXIO errors are passed instead of
handling other errors.
- The caller always call finstall() for indx descriptor, so we can assume
it is set. Actually the filedesc lock is dropped between finstall() and
dupfdopen(), so there is a window there for another thread to close the
indx descriptor, but it will be closed in next commit.
Reviewed by: mjg
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
| |
This function is static and the only caller always passes 0 as low.
While here update note about return values in comment.
Reviewed by: pjd
Approved by: trasz (mentor)
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If fdalloc() decides to grow fdtable it does it once and at most doubles
the size. This still may be not enough for sufficiently large fd. Use fd
in calculations of new size in order to fix this.
When growing the table, fd is already equal to first free descriptor >= minfd,
also fdgrowtable() no longer drops the filedesc lock. As a result of this there
is no need to retry allocation nor lookup.
Fix description of fd_first_free to note all return values.
In co-operation with: pjd
Approved by: trasz (mentor)
MFC after: 1 month
|
|
|
|
|
|
| |
work properly.
Reported by: davidxu
|
|
|
|
|
|
|
| |
retry finding free file descriptor only once after fdgrowtable().
Spotted by: pluknet
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
| |
introduced a minute ago.
This code duplication was responsible for the bug fixed in r236853.
Discussed with: kib
Tested by: pho
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
|
| |
code duplication in kern_close() and do_dup().
This is committed separately from the actual removal of the duplicated
code, as the combined diff was very hard to read.
Discussed with: kib
Tested by: pho
MFC after: 1 month
|
|
|
|
|
|
|
|
| |
kern_close().
Discussed with: kib
Tested by: pho
MFC after: 1 month
|
|
|
|
|
|
|
|
| |
kern_close() close together.
Discussed with: kib
Tested by: pho
MFC after: 1 month
|
|
|
|
|
|
|
|
|
| |
check if descriptor changed from under us. Replace the check with an
assert.
Discussed with: kib
Tested by: pho
MFC after: 1 month
|
|
|
|
|
|
|
|
| |
on the underlying object and not on the capability itself.
Discussed with: rwatson
Sponsored by: FreeBSD Foundation
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
| |
MFC after: 1 month
|
|
|
|
|
|
|
| |
we now use sx lock for filedesc structure protection.
Reviewed by: kib
MFC after: 1 month
|
|
|
|
|
| |
MFC after: 1 month
MFC with: r236820
|
|
|
|
|
| |
Reviewed by: tegge
MFC after: 1 month
|
|
|
|
|
| |
MFC after: 1 month
MFC with: r236731
|
|
|
|
|
|
|
| |
Assert that instead of setting it to 0.
Sponsored by: FreeBSD Foundation
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
| |
outside the range of valid file descriptors
PR: kern/164970
Submitted by: Peter Jeremy <peterjeremy@acm.org>
Reviewed by: jilles
Approved by: cperciva
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
via procstat(1) and fstat(1):
- Change shm file descriptors to track the pathname they are associated
with and add a shm_path() method to copy the path out to a caller-supplied
buffer.
- Use the fo_stat() method of shared memory objects and shm_path() to
export the path, mode, and size of a shared memory object via
struct kinfo_file.
- Add a struct shmstat to the libprocstat(3) interface along with a
procstat_get_shm_info() to export the mode and size of a shared memory
object.
- Change procstat to always print out the path for a given object if it
is valid.
- Teach fstat about shared memory objects and to display their path,
mode, and size.
MFC after: 2 weeks
|
| |
|
|
|
|
| |
(while I'm here, wrap other long lines)
|