From owner-svn-src-all@FreeBSD.ORG Fri Apr 2 15:12:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B177E106566B; Fri, 2 Apr 2010 15:12:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0D5A8FC15; Fri, 2 Apr 2010 15:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o32FCVYL093285; Fri, 2 Apr 2010 15:12:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o32FCVUM093282; Fri, 2 Apr 2010 15:12:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004021512.o32FCVUM093282@svn.freebsd.org> From: Andriy Gapon Date: Fri, 2 Apr 2010 15:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206097 - in head/sys: geom kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 15:12:31 -0000 Author: avg Date: Fri Apr 2 15:12:31 2010 New Revision: 206097 URL: http://svn.freebsd.org/changeset/base/206097 Log: bo_bsize: revert r205860 and take an alternative approch in getblk In r205860 I missed the fact that there is code that strongly assumes that devvp bo_bsize is equal to underlying provider's sectorsize. In those places it is hard to obtain the sectorsize in an alternative way if devvp bo_bsize is set to something else. So, I am reverting bo_bsize assigment in g_vfs_open. Instead, in getblk I use DEV_BSIZE block size for b_offset calculation if vp is a disk vp as reported by vn_isdisk. This should coinside with vp being a devvp. Reported by: Mykola Dzham Tested by: Mykola Dzham Pointyhat to: avg MFC after: 2 weeks X-ToDo: convert bread(devvp) in all fs to use bo_bsize-d blocks Modified: head/sys/geom/geom_vfs.c head/sys/kern/vfs_bio.c Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Fri Apr 2 14:37:55 2010 (r206096) +++ head/sys/geom/geom_vfs.c Fri Apr 2 15:12:31 2010 (r206097) @@ -179,7 +179,7 @@ g_vfs_open(struct vnode *vp, struct g_co bo = &vp->v_bufobj; bo->bo_ops = g_vfs_bufops; bo->bo_private = cp; - bo->bo_bsize = DEV_BSIZE; + bo->bo_bsize = pp->sectorsize; gp->softc = bo; return (error); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Apr 2 14:37:55 2010 (r206096) +++ head/sys/kern/vfs_bio.c Fri Apr 2 15:12:31 2010 (r206097) @@ -2678,7 +2678,7 @@ loop: */ if (flags & GB_NOCREAT) return NULL; - bsize = bo->bo_bsize; + bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; offset = blkno * bsize; vmio = vp->v_object != NULL; maxsize = vmio ? size + (offset & PAGE_MASK) : size;