freebsd-skq/sys
kib dea9380e34 Fix dirty buf exhaustion easily triggered with msdosfs.
If truncate(2) is performed on msdosfs file, which extends the file by
system-depended large amount, fs creates corresponding amount of dirty
delayed-write buffers, which can consume all buffers.  Such buffers
cannot be flushed by the bufdaemon because the ftruncate() thread owns
the vnode lock.  So the system runs out of free buffers, and even
truncate() thread starves, which means deadlock because it owns the
vnode lock.

Fix this by doing vnode fsync in extendfile() when low memory or low
buffers condition detected, which flushes all dirty buffers belonging
to the file being extended.

Note that the more usual fallback to bawrite() does not work
acceptable in this situation, because it would only allow one buffer
to be recycled.  Other filesystems, most important UFS, do not allow
userspace to create arbitrary amount of dirty delayed-write buffers
without feedback, so bawrite() is good enough for them.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-04-09 19:55:02 +00:00
..
amd64 pci_cfgreg.c: Use io port config access for early boot time. 2019-04-09 18:07:17 +00:00
arm cpsw: use phy-handle in FDT to find PHY address 2019-04-03 21:01:53 +00:00
arm64 Merge ACPICA 20190329. 2019-03-29 20:21:28 +00:00
bsm Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
cam List few more ATA commands. 2019-04-03 18:27:54 +00:00
cddl Introduce funlinkat syscall that always us to check if we are removing 2019-04-06 09:34:26 +00:00
compat Regen after r345982. 2019-04-06 09:37:10 +00:00
conf Style only change: Prefer $() to `` 2019-04-08 18:25:14 +00:00
contrib MFV: r345969 2019-04-06 06:02:42 +00:00
crypto Embedded chacha: Add 0-bit iv + 128-bit counter mode 2019-03-01 23:30:23 +00:00
ddb ddb: Print the thread's pcb in 'show thread' 2019-02-09 21:08:19 +00:00
dev Don't pre-reserve resources for CPU devices when they are set. 2019-04-09 19:22:08 +00:00
dts Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with 2019-02-06 06:03:44 +00:00
fs Fix dirty buf exhaustion easily triggered with msdosfs. 2019-04-09 19:55:02 +00:00
gdb
geom Implement automatic online expansion of GELI providers - if the underlying 2019-04-03 23:57:37 +00:00
gnu Correct my previous correction to the license. It now matches the text 2019-03-07 22:34:45 +00:00
i386 pci_cfgreg.c: Use io port config access for early boot time. 2019-04-09 18:07:17 +00:00
isa Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
kern Factor out section loading into a separate function. 2019-04-09 15:24:38 +00:00
kgssapi * Handle SIGPIPE in gssd 2019-02-21 01:30:37 +00:00
libkern Add non-sleepable strdup variant strdup_flags 2019-02-20 20:48:10 +00:00
mips The Atheros AR7241 has 20 GPIO pins 2019-03-25 07:48:52 +00:00
modules Add g_label_flashmap.c to the module, should have been part of r345480. 2019-04-07 16:33:22 +00:00
net Replace read_random(9) with more appropriate arc4rand(9) KPIs 2019-04-04 01:02:50 +00:00
net80211 net80211: correct check for SMPS node flags updates 2019-03-18 02:40:22 +00:00
netgraph Remove 'dir' argument in ng_ipfw_input, since ip_fw_args now has this info. 2019-03-14 22:30:05 +00:00
netinet Use IN_foo() macros from sys/netinet/in.h inplace of handcrafted code 2019-04-04 19:01:13 +00:00
netinet6 Do not perform DAD on stf(4) interfaces. 2019-03-30 18:00:44 +00:00
netipsec Replace read_random(9) with more appropriate arc4rand(9) KPIs 2019-04-04 01:02:50 +00:00
netpfil Use IN_foo() macros from sys/netinet/in.h inplace of handcrafted code 2019-04-04 19:01:13 +00:00
netsmb Remove unused argument to priv_check_cred. 2018-12-11 19:32:16 +00:00
nfs
nfsclient
nfsserver
nlm
ofed Mechanical cleanup of epoch(9) usage in network stack. 2019-01-09 01:11:19 +00:00
opencrypto Fix another bug introduced during the review process of r344140: 2019-02-25 19:14:16 +00:00
powerpc powerpc/powernv: Fix major bugs in opal_flash 2019-04-06 02:39:56 +00:00
riscv RISC-V: initialize pcpu slightly earlier 2019-04-07 20:12:24 +00:00
rpc Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled. 2019-04-04 01:23:06 +00:00
security Create kernel module to parse Veriexec manifest based on envs 2019-04-03 03:57:37 +00:00
sparc64 Add mpr, mps, mpt to NOTES file 2019-04-05 02:54:02 +00:00
sys Bump FreeBSD version after r345982. 2019-04-07 16:07:41 +00:00
teken Attempt to complete fixing programmable function keys for syscons. 2019-02-20 02:14:41 +00:00
tests Regularize the Netflix copyright 2019-02-04 21:28:25 +00:00
tools make_dtb.sh: Use $CPP instead of assuming that cpp is in $PATH 2018-12-14 23:53:28 +00:00
ufs Handle races when remounting UFS volume from ro to rw. 2019-04-08 15:20:05 +00:00
vm Fix mis-merge. 2019-04-05 16:12:35 +00:00
x86 pci_cfgreg.c: Use io port config access for early boot time. 2019-04-09 18:07:17 +00:00
xdr
xen xen: introduce a new way to setup event channel upcall 2019-01-30 11:34:52 +00:00
Makefile