From owner-svn-src-stable@FreeBSD.ORG Fri May 31 11:41:02 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C70FFA1D; Fri, 31 May 2013 11:41:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9091995; Fri, 31 May 2013 11:41:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VBf23O064182; Fri, 31 May 2013 11:41:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VBf2uL064180; Fri, 31 May 2013 11:41:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305311141.r4VBf2uL064180@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 May 2013 11:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251178 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 11:41:02 -0000 Author: kib Date: Fri May 31 11:41:01 2013 New Revision: 251178 URL: http://svnweb.freebsd.org/changeset/base/251178 Log: MFC r250966: Fix the data corruption on the swap-backed md. Assign the rv variable a success code if the pager was not asked for the page. Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Fri May 31 09:37:33 2013 (r251177) +++ stable/9/sys/dev/md/md.c Fri May 31 11:41:01 2013 (r251178) @@ -669,7 +669,9 @@ mdstart_swap(struct md_s *sc, struct bio sf = sf_buf_alloc(m, SFB_CPUPRIVATE); VM_OBJECT_LOCK(sc->object); if (bp->bio_cmd == BIO_READ) { - if (m->valid != VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, 0); if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); @@ -691,6 +693,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); @@ -702,6 +706,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin();