svn commit: r255168 - stable/9/sys/kern

Konstantin Belousov kib at FreeBSD.org
Tue Sep 3 05:20:43 UTC 2013


Author: kib
Date: Tue Sep  3 05:20:42 2013
New Revision: 255168
URL: http://svnweb.freebsd.org/changeset/base/255168

Log:
  MFC r254945:
  When allocating a pbuf for the cluster write, do not sleep waiting
  for the available pbuf when passed vnode is backing md(4). Other i/o
  directed to the same md device might already hold pbufs, and then we
  could deadlock since only our progress can free a pbuf needed for
  wakeup.

Modified:
  stable/9/sys/kern/vfs_cluster.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/vfs_cluster.c
==============================================================================
--- stable/9/sys/kern/vfs_cluster.c	Tue Sep  3 02:28:31 2013	(r255167)
+++ stable/9/sys/kern/vfs_cluster.c	Tue Sep  3 05:20:42 2013	(r255168)
@@ -846,7 +846,9 @@ cluster_wbuild_gb(struct vnode *vp, long
 		  (tbp->b_bcount != tbp->b_bufsize) ||
 		  (tbp->b_bcount != size) ||
 		  (len == 1) ||
-		  ((bp = getpbuf(&cluster_pbuf_freecnt)) == NULL)) {
+		  ((bp = (vp->v_vflag & VV_MD) != 0 ?
+		  trypbuf(&cluster_pbuf_freecnt) :
+		  getpbuf(&cluster_pbuf_freecnt)) == NULL)) {
 			totalwritten += tbp->b_bufsize;
 			bawrite(tbp);
 			++start_lbn;


More information about the svn-src-all mailing list