Age | Commit message (Collapse) | Author |
|
ok bluhm@
|
|
within softdep_process_worklist. When this is called from the syncer
a vnode may be legtitimately locked by someone waiting for buffers
so we need to skip anything locked. FreeBSD appears to have a similar
change. This avoids a deadlock where the syncer ends up waiting for
the inode lock that his held by someone waiting for buffer space.
Found by bluhm@ and some genua folks
ok bluhm@
|
|
OK visa@
|
|
Ensure that io to a file backing a vnd is IO_SYNC, so IO to a
vnd device is both synchronous and not cached in the buffer cache.
This allows the "mount" regress to work repeatably, and avoids
a situation where when the buffer cache cleaner runs to clear
dirty buffers while people are waiting, it actually increases the
dirty buffers when the writes to the underlying vnd are also
delayed.
ok bluhm@
|
|
ok bluhm@, cheloha@
|
|
|
|
|
|
|
|
uvm_vnp_setsize() which is not free from side-effects.
ok visa@
|
|
protected properly and files without any x bit set were accidentaly considered
executable when checked with access(2).
Issues found and reported by deraadt, halex, reyk, tb
ok deraadt
|
|
dedicated functions.
OK deraadt@ mpi@
|
|
does.
ok deraadt@ kettenis@
|
|
`mount -uo async,nosoftdep /mnt' would set "async" but keep "softdep"
untouched on a read/write mount.
OK deraadt krw beck bluhm
|
|
OK mpi@
|
|
OK mpi@
|
|
unnecessary because curproc always does the locking.
OK mpi@
|
|
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.
OK mpi@, deraadt@
|
|
Fixes softdep+UFS2. Found out the hard way by naddy@
ok visa@ naddy@ deraadt@
|
|
OK visa@
|
|
safely to disk. The subsystem seems to be working as intended! :)
|
|
are pushed to disk. Dangling vnodes (unlinked files still in use) and
vnodes undergoing change by long-running syscalls are identified -- and
such filesystems are marked dirty on-disk while we are suspended (in case
power is lost, a fsck will be required). Filesystems without dangling or
busy vnodes are marked clean, resulting in faster boots following
"battery died" circumstances.
Tested by numerous developers, thanks for the feedback.
|
|
fails, adapted from FreeBSD. Also avoid clearing the buffer if it
was cleared when allocated. OK deraadt@ otto@
|
|
ok deraadt@ krw@
|
|
ok millert@ krw@
|
|
Change mountpoint to RDONLY a little later. Seems to improve the
rw->ro transition a bit.
|
|
other pending inode attribute changes. We appear to be missing UFS_UPDATE()
calls in some paths with the result that bsd.rd remounting the newly
created /mnt to RO would lose the GID changes on device inodes there.
This only affected devices, as they're the only inodes where timestamp
writes are delayed.
ok deraadt@
|
|
The deadlock happens when softdep gets the same buffer in the BMSAFEMAP case
that it already called getdirtybuf() on and made busy at the top of the loop.
when this is the case, skip the BMSAFEMAP case and simply write the buffer
out at the bottom of the loop as always. This avoids calling getdirtybuf()
a second time on the same buffer we already took for exclusive use ourself
and have not yet written out.
While I'm in here add a KASSERT for the similar case above, which I don't
think can happen but we would deadlock in the same way if it does.
testing by and ok bluhm@
|
|
and can cause pending IO's on wd(4) to be thrown away. Still
trying to find a solution.
|
|
for blocks re-fetchable from the filesystem. However at reboot time,
filesystems are unmounted, and since processes lack backing store they
are killed. Since the scheduler is still running, in some cases init is
killed... which drops us to ddb [noted by bluhm]. Solution is to convert
filesystems to read-only [proposed by kettenis]. The tale follows:
sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which
completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT()
with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a
copyin() late... so store the sizes in vfsconflist[] and move the copyin()
to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill
legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is
sharp and rusty especially wrt softdep, so fix some bugs adn add
~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help,
so tie them to &dead_vnops.
ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but
this issue is seperate and will be dealt with in time.
couple hundred reboots by bluhm and myself, advice from guenther and
others at the hut
|
|
process has a chance to create new dirty vnodes. Resolving soft
dependencies adds vnodes to the dirty list.
In softdep_flushfiles() vnodes and softdeps are flushed in a loop.
But if they sleep, it is not guaranteed that all vnodes have been
flushed when the softdep worklist flush reports that nothing has
to be done.
The solution is to do a final vnode flush after the softdep worklist
has been flushed. Then the dirty list is empty and the final check
in dounmount_leaf() does not panic with "unmount: dangling vnode".
OK mikeb@
|
|
ok deraadt@
|
|
on amd64 and i386.
|
|
(Missed this chunk as part of previous commit to libsa/ufs.c)
OK krw@
|
|
initial thread
ok jsing@ kettenis@
|
|
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
without root privileges. This is only the kernel/mount flag; additional
work in the build Makefile's will be necessary such that the files in
$DESTDIR are created with correct permissions.
tedu couldn't find anything wrong with it in a quick review
idea & ok deraadt
|
|
|
|
|
|
sbin/fsck_ffs build. bad natano!
reported by naddy
|
|
ffs code.
ok mpi tedu
|
|
trivial change to use rrw locks instead. All it needs is LK_* defines
for the RW_* flags.
tested by naddy and sthen on package building infrastructure
input and ok jmc mpi tedu
|
|
ok tedu@ visa@
|
|
This eliminates the idiom 'arc4random() % X' (where X + 1 is not a
power of two) from base.
Part of a patch from Matthew Martin from end of last year.
ok tedu@ (a long time ago), natano@
|
|
cluster_write().
ok beck zhuk
|
|
usb stack was busy, the kernel could trigger an uvm fault. There
is a race between vop_generic_revoke() and sys_mount() where vgonel()
could reset v_specinfo. Then v_specmountpoint is no longer valid.
So after sleeping, msdosfs_mountfs() could crash in the error path.
The code in the different *_mountfs() functions was inconsistent,
implement the same check everywhere.
OK krw@ natano@
|
|
random data on the disk as an inode. Thus avoiding crashes when
translating a bogus filehandle to a vnode. Yes, I'm looking at you,
NFS!
Adapted from a diff by Christos Zoulas via NetBSD, pointed out by
kurt@.
ok beck@
|
|
logical block is contiguous to the previous one.
This logic is a left-over of the pre-bread_cluster() area. When the
read-ahead version of bread(9) was used to prefetch blocks. Nowadays
bread_cluster() do the right thing (tm).
ok stefan@
|
|
could end up in an inconsistent state. The fstype dependent
mp->mnt_data was NULL, but the general mp was still listed as a
valid mount point. Next access to the file system would crash with
a NULL pointer dereference.
If closing the device fails, the mount point must go away anyway.
There is nothing we can do about it. Remove the workaround for the
EIO error in the general unmount code, but do not generate any error
in the file system specific unmount functions.
OK natano@ beck@
|
|
torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt
|
|
OK krw@ natano@ as part of a larger diff
|