Plug up the lock lock leakage when exporting to a short buffer.

Reported by:	Alexander Leidinger
Submitted by:	mjg
MFC after:	1 week
This commit is contained in:
trociny 2013-07-01 03:27:14 +00:00
parent 5eeda65400
commit 68a112b157

View File

@ -3272,6 +3272,8 @@ export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt,
if (efbuf->remainder < kif->kf_structsize) {
/* Terminate export. */
efbuf->remainder = 0;
if (efbuf->fdp != NULL && !locked)
FILEDESC_SLOCK(efbuf->fdp);
return (0);
}
efbuf->remainder -= kif->kf_structsize;