Date: Tue, 3 Sep 2013 05:20:43 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255168 - stable/9/sys/kern Message-ID: <201309030520.r835KhCQ038410@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309030520.r835KhCQ038410>