freebsd-nq/sys
Kirk McKusick d2a28cb080 The bread() function was inconsistent about whether it would return
a buffer pointer in the event of an error (for some errors it would
return a buffer pointer and for other errors it would not return a
buffer pointer). The cluster_read() function was similarly inconsistent.

Clients of these functions were inconsistent in handling errors.
Some would assume that no buffer was returned after an error and
would thus lose buffers under certain error conditions. Others would
assume that brelse() should always be called after an error and
would thus panic the system under certain error conditions.

To correct both of these problems with minimal code churn, bread()
and cluster_write() now always free the buffer when returning an
error thus ensuring that buffers will never be lost. The brelse()
routine checks for being passed a NULL buffer pointer and silently
returns to avoid panics. Thus both approaches to handling error
returns from bread() and cluster_read() will work correctly.

Future code should be written assuming that bread() and cluster_read()
will never return a buffer with an error, so should not attempt to
brelse() the buffer when an error is returned.

Reviewed by: kib
2016-01-27 21:23:01 +00:00
..
amd64 Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
arm Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
arm64 Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
boot ficl on i386 should cast to unsigned char output to support efi i386 2016-01-27 16:45:23 +00:00
bsm Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: 2015-12-20 23:22:04 +00:00
cam Hide "soconnect() error" messages under bootverbose. 2016-01-22 09:32:19 +00:00
cddl MFV r294819: 6495 Fix mutex leak in dmu_objset_find_dp 2016-01-26 13:45:41 +00:00
compat Update and add various macros to the LinuxKPI and resolve a macro 2016-01-26 15:26:35 +00:00
conf Fix generation of dependency rules for the LinuxKPI, the MLX5 driver 2016-01-27 14:46:30 +00:00
contrib Import Annapurna Labs Alpine HAL for networking 2016-01-26 15:22:04 +00:00
crypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
ddb Add helper to catch single step debug event and distinguish it from bkpt 2015-11-27 19:03:59 +00:00
dev filemon_comment has nothing to do with wrappers so move it out of filemon_wrapper.c. 2016-01-27 21:17:43 +00:00
fs ext2fs: passthrough any extra timestamps to the dinode struct. 2016-01-24 23:24:47 +00:00
gdb
geom Teach the flashmap code about the SPI flash. 2016-01-23 05:26:29 +00:00
gnu
i386 Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
isa Convert rman to use rman_res_t instead of u_long 2016-01-27 02:23:54 +00:00
kern The bread() function was inconsistent about whether it would return 2016-01-27 21:23:01 +00:00
kgssapi Unset the gss kernel state when gssd exits 2016-01-01 17:06:16 +00:00
libkern libkern: ffs, fls: s/4/3/ the 3rd BSD clause 2015-10-22 21:04:47 +00:00
mips Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
modules ext2fs: Bring back the htree dir_index implementation. 2016-01-21 14:50:28 +00:00
net Provide TCPSTAT_DEC() and TCPSTAT_FETCH() macros. 2016-01-27 00:20:07 +00:00
net80211 net80211: reduce stack usage for ieee80211_ioctl*() methods. 2016-01-24 23:35:20 +00:00
netgraph Make ng_netflow(9) use new routing KPI. 2016-01-14 13:14:12 +00:00
netinet Rename netinet/tcp_cc.h to netinet/cc/cc.h. 2016-01-27 17:59:39 +00:00
netinet6 MFP r287070,r287073: split radix implementation and route table structure. 2016-01-25 06:33:15 +00:00
netipsec Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
netnatm
netpfil cleanup and document in some detail the internals of the testing code 2016-01-27 02:22:31 +00:00
netsmb The problem report was for a crash that happened when smbfs was 2015-11-18 23:04:01 +00:00
nfs MFP r287070,r287073: split radix implementation and route table structure. 2016-01-25 06:33:15 +00:00
nfsclient
nfsserver
nlm
ofed LinuxKPI list updates: 2016-01-26 15:12:31 +00:00
opencrypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
pc98 Convert rman to use rman_res_t instead of u_long 2016-01-27 02:23:54 +00:00
powerpc Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
riscv/include Correct RISC-V exception types. 2016-01-18 17:49:32 +00:00
rpc Improve locking of sg_threadcount. 2015-11-19 08:04:05 +00:00
security Busy the mount point which is the owner of the audit vnode, around 2016-01-16 10:06:33 +00:00
sparc64 Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
sys Convert ss_sp in stack_t and sigstack to void *. 2016-01-27 17:55:01 +00:00
teken
tests Style 9 changes. 2015-11-12 10:31:14 +00:00
tools
ufs The bread() function was inconsistent about whether it would return 2016-01-27 21:23:01 +00:00
vm Typo in comment. 2016-01-24 13:38:41 +00:00
x86 Convert rman to use rman_res_t instead of u_long 2016-01-27 02:23:54 +00:00
xdr
xen xenbus: add a comment with the names of the generated accessors 2016-01-15 14:34:31 +00:00
Makefile