#
91b5592a |
| 06-Dec-2024 |
Rick Macklem <rmacklem@FreeBSD.org> |
fs: Add static asserts for the size of fid structures
File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct f
fs: Add static asserts for the size of fid structures
File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct fid.
This patch adds _Static_assert()s to check for this.
ZFS and fuse already have _Static_assert()s.
Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47936
show more ...
|
Revision tags: release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0 |
|
#
ca39f233 |
| 11-Dec-2023 |
Konstantin Belousov <kib@FreeBSD.org> |
ufs: do not leave around empty buffers shadowing disk content
If the ffs_write() operation specified to overwrite the whole buffer, ffs tries to save the read by not validating allocated buffer. The
ufs: do not leave around empty buffers shadowing disk content
If the ffs_write() operation specified to overwrite the whole buffer, ffs tries to save the read by not validating allocated buffer. Then uiommove() might fail with EFAULT, in which case pages are left zeroed and marked valid but not read from the disk. Then vn_io_fault() logic retries the write after holding the user pages to avoid EFAULTs. In erronous case of really faulty buffer, or in contrived case of writing from file to itself, we are left with zeroed buffer instead of valid content written back to disk.
Handle the situation by releasing non-cached buffer on fault, instead of clearing it. Note that buffers with alive dependencies cannot be released, but also either they cannot have valid content on the disk because dependency on data buffer means that it was not yet written, or they were reallocated by fragment extension or ffs_reallocbks(), and are already fully valid.
Reported by: kevans Discussed with: mav In collaboration with: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
#
29363fb4 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
a87c6962 |
| 09-Sep-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
ufs: restore name cache fast path lookup
Found by: dchagin Fixes: f3c81b973897 ("ufs: add missing vop_fplookup ops")
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
831b1ff7 |
| 28-Jul-2023 |
Kirk McKusick <mckusick@FreeBSD.org> |
UFS/FFS: Migrate to modern uintXX_t from u_intXX_t.
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html move to the modern uintXX_t. While here also migrate u_char to uint8_
UFS/FFS: Migrate to modern uintXX_t from u_intXX_t.
As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html move to the modern uintXX_t. While here also migrate u_char to uint8_t. Where other kernel interfaces allow, migrate u_long to uint64_t.
No functional changes intended.
MFC-after: 1 week Sponsored-by: The FreeBSD Foundation
show more ...
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
#
4032c388 |
| 07-Apr-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
ufs: add missing vop_fplookup ops to fifo vectors
Reported-by: syzbot+a324b64ef9a933659c1c@syzkaller.appspotmail.com
|
Revision tags: release/13.2.0 |
|
#
f3c81b97 |
| 06-Apr-2023 |
Mateusz Guzik <mjg@FreeBSD.org> |
ufs: add missing vop_fplookup ops
|
Revision tags: release/12.4.0 |
|
#
87525ef9 |
| 18-Sep-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
FFS: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
PR: 164793 Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differe
FFS: truncate write if it would exceed the fs max file size or RLIMIT_FSIZE
PR: 164793 Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36625
show more ...
|
#
cc65a412 |
| 18-Sep-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
filesystems: return error from vn_rlimit_fsize() instead of EFBIG
Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https
filesystems: return error from vn_rlimit_fsize() instead of EFBIG
Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36625
show more ...
|
#
064e6b43 |
| 13-Jul-2022 |
Kirk McKusick <mckusick@FreeBSD.org> |
Rewrite function definitions in the UFS/FFS code base with identifier lists.
The K&R style in UFS and other places in the tree's days are numbered as this syntax is removed in C2x proposal N2432:
Rewrite function definitions in the UFS/FFS code base with identifier lists.
The K&R style in UFS and other places in the tree's days are numbered as this syntax is removed in C2x proposal N2432:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf
Though running to nearly 6000 lines of diffs this update should cause no functional change to the code.
Requested by: Warner Losh MFC after: 2 weeks
show more ...
|
#
82817f26 |
| 22-Jun-2022 |
Chuck Silvers <chs@FreeBSD.org> |
ffs: fix vn_io_fault_pgmove() offset for PAGE_SIZE > block size
The "offset" argument to vn_io_fault_pgmove() is supposed to be the offset within the page, but for ffs we currently use the offset wi
ffs: fix vn_io_fault_pgmove() offset for PAGE_SIZE > block size
The "offset" argument to vn_io_fault_pgmove() is supposed to be the offset within the page, but for ffs we currently use the offset within the block. When the block size is at least as large as the page size then these values are the same, but when the page size is larger than the block size then we need to add the offset of the block within the page as well.
Sponsored by: Netflix
Reviewed by: mckusick, kib, markj Differential Revision: https://reviews.freebsd.org/D34835
show more ...
|
Revision tags: release/13.1.0 |
|
#
0af463e6 |
| 05-Feb-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
ffs_read(): lock buffers after snaplk with LK_NOWITNESS
Reviewed and tested by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34
ffs_read(): lock buffers after snaplk with LK_NOWITNESS
Reviewed and tested by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34179
show more ...
|
#
99aa3b73 |
| 28-Jan-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
ffs: lock buffers after snaplk with LK_NOWITNESS
Reviewed by: mckusick Discussed with: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://revi
ffs: lock buffers after snaplk with LK_NOWITNESS
Reviewed by: mckusick Discussed with: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34073
show more ...
|
#
8d8589b3 |
| 18-Jan-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
ufs: be more persistent with finishing some operations
when the vnode is doomed after relock. The mere fact that the vnode is doomed does not prevent us from doing UFS operations on it while it is
ufs: be more persistent with finishing some operations
when the vnode is doomed after relock. The mere fact that the vnode is doomed does not prevent us from doing UFS operations on it while it is still belongs to UFS, which is determined by non-NULL v_data. Not finishing some operations, e.g. not syncing the inode block only because the vnode started reclamation, is not correct.
Add macro IS_UFS() which incapsulates the v_data != NULL, and use it instead of VN_IS_DOOMED() for places where the operation completion is important.
Reviewed by: markj, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34072
show more ...
|
Revision tags: release/12.3.0 |
|
#
2030ee0e |
| 20-Oct-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
ufs: remove write-only variables
Mark variables as __diagused for invariant-only vars
Reviewed by: imp, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://rev
ufs: remove write-only variables
Mark variables as __diagused for invariant-only vars
Reviewed by: imp, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32577
show more ...
|
#
197a4f29 |
| 17-Sep-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
buffer pager: allow get_blksize method to return error
Reported and reviewed by: asomers Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31
buffer pager: allow get_blksize method to return error
Reported and reviewed by: asomers Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31998
show more ...
|
#
f784da88 |
| 18-May-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
Move mnt_maxsymlinklen into appropriate fs mount data structures
Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-MFC-Note: struct mount layout Different
Move mnt_maxsymlinklen into appropriate fs mount data structures
Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-MFC-Note: struct mount layout Differential revision: https://reviews.freebsd.org/D30325
show more ...
|
#
e3d67595 |
| 13-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
b_vflags update requries bufobj lock
The trunc_dependencies() issue was reported by Alexander Lochmann <alexander.lochmann@tu-dortmund.de>, who found the problem by performing lock analysis using Lo
b_vflags update requries bufobj lock
The trunc_dependencies() issue was reported by Alexander Lochmann <alexander.lochmann@tu-dortmund.de>, who found the problem by performing lock analysis using LockDoc, see https://doi.org/10.1145/3302424.3303948.
Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
Revision tags: release/13.0.0 |
|
#
8742817b |
| 01-Mar-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
FFS extattr: fix handling of the tail
There are three issues with change that stopped truncating ea area before write, and resulted in possible zero tail in the ea area: - Truncate to zero checked i
FFS extattr: fix handling of the tail
There are three issues with change that stopped truncating ea area before write, and resulted in possible zero tail in the ea area: - Truncate to zero checked i_ea_len after the reference was dropped, making the last drop effectively truncate to zero length always. - Loop to fill uio for zeroing specified too large length, that triggered assert in normal situation. - Integrity check could trip over the tail, instead we must allow partial header or header with zero length, and clamp ea image in memory at it.
Reported by: arichardson Tested by: arichardson, pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixup: 5e198e7646a27412c0541719f7bf1bbc0bd89223 Differential Revision: https://reviews.freebsd.org/D28999
show more ...
|
#
6f30ac99 |
| 21-Feb-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing
softdep_prealloc() must be called to ensure enough journal space is available, before ffs_extwrite(). Also it must be don
Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing
softdep_prealloc() must be called to ensure enough journal space is available, before ffs_extwrite(). Also it must be done before taking ffs_lock_ea(), because it calls ffs_syncvnode(), potentially dropping the vnode lock.
Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|
#
5e198e76 |
| 21-Feb-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
ffs_close_ea: do not relock vnode under lock_ea
ffs_lock_ea is after the vnode lock, so vnode must not be relocked under lock_ea. Move ffs_truncate() call in ffs_close_ea() after the lock_ea is drop
ffs_close_ea: do not relock vnode under lock_ea
ffs_lock_ea is after the vnode lock, so vnode must not be relocked under lock_ea. Move ffs_truncate() call in ffs_close_ea() after the lock_ea is dropped, and only truncate to length zero, since this is the only mode supported by ffs_truncate() for EAs. Previously code did truncation and then write.
Zero the part of the ext area that is unused, if truncation is due but not done because ea area is not zero-length.
Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|
#
c6d68ca8 |
| 20-Feb-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
ffs_vnops.c: style
Use local var to shorten ap->a_vp expression.
Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
#
49831462 |
| 18-Feb-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
ffs: do not call softdep_prealloc() from UFS_BALLOC()
Do it in ffs_write(), where we can gracefuly handle relock and its consequences. In particular, recheck the v_data to see if the vnode reclamati
ffs: do not call softdep_prealloc() from UFS_BALLOC()
Do it in ffs_write(), where we can gracefuly handle relock and its consequences. In particular, recheck the v_data to see if the vnode reclamation ended, and return EBADF when we cannot proceed with the write.
Reviewed by: mckusick Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
show more ...
|