From owner-svn-src-all@freebsd.org Wed Mar 22 07:53:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95ADFD17266; Wed, 22 Mar 2017 07:53:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6511A1BAC; Wed, 22 Mar 2017 07:53:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2M7rv6X086511; Wed, 22 Mar 2017 07:53:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2M7rvgN086510; Wed, 22 Mar 2017 07:53:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703220753.v2M7rvgN086510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Mar 2017 07:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315704 - stable/11/sys/geom X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Wed, 22 Mar 2017 07:53:58 -0000 Author: mav Date: Wed Mar 22 07:53:57 2017 New Revision: 315704 URL: https://svnweb.freebsd.org/changeset/base/315704 Log: MFC r314908: When chunking large DIOCGDELETE, do it on stripe edge. Modified: stable/11/sys/geom/geom_dev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/geom_dev.c ============================================================================== --- stable/11/sys/geom/geom_dev.c Wed Mar 22 07:52:25 2017 (r315703) +++ stable/11/sys/geom/geom_dev.c Wed Mar 22 07:53:57 2017 (r315704) @@ -458,7 +458,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd { struct g_consumer *cp; struct g_provider *pp; - off_t offset, length, chunk; + off_t offset, length, chunk, odd; int i, error; cp = dev->si_drv2; @@ -518,6 +518,13 @@ g_dev_ioctl(struct cdev *dev, u_long cmd g_dev_del_max_sectors * cp->provider->sectorsize) { chunk = g_dev_del_max_sectors * cp->provider->sectorsize; + if (cp->provider->stripesize > 0) { + odd = (offset + chunk + + cp->provider->stripeoffset) % + cp->provider->stripesize; + if (chunk > odd) + chunk -= odd; + } } error = g_delete_data(cp, offset, chunk); length -= chunk;