Date: Tue, 27 Aug 2013 01:31:12 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254945 - head/sys/kern Message-ID: <201308270131.r7R1VCFx077815@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Aug 27 01:31:12 2013 New Revision: 254945 URL: http://svnweb.freebsd.org/changeset/base/254945 Log: 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. Obtained from: projects/vm6 Reminded and tested by: pho MFC after: 1 week Modified: head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Tue Aug 27 01:08:55 2013 (r254944) +++ head/sys/kern/vfs_cluster.c Tue Aug 27 01:31:12 2013 (r254945) @@ -837,7 +837,9 @@ cluster_wbuild(struct vnode *vp, long si (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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308270131.r7R1VCFx077815>