Date: Wed, 17 Feb 2016 19:39:57 +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: r295716 - head/sys/kern Message-ID: <201602171939.u1HJdv05040899@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Feb 17 19:39:57 2016 New Revision: 295716 URL: https://svnweb.freebsd.org/changeset/base/295716 Log: In bnoreuselist(), check both ends of the specified logical block numbers range. This effectively skips indirect and extdata blocks on the buffer queue. Since their logical block numbers are negative, bnoreuselist() could loop infinitely. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Feb 17 19:11:09 2016 (r295715) +++ head/sys/kern/vfs_subr.c Wed Feb 17 19:39:57 2016 (r295716) @@ -1673,7 +1673,8 @@ bnoreuselist(struct bufv *bufv, struct b for (lblkno = startn;;) { again: bp = BUF_PCTRIE_LOOKUP_GE(&bufv->bv_root, lblkno); - if (bp == NULL || bp->b_lblkno >= endn) + if (bp == NULL || bp->b_lblkno >= endn || + bp->b_lblkno < startn) break; error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo), "brlsfl", 0, 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602171939.u1HJdv05040899>