From owner-freebsd-geom@freebsd.org Sat Jul 9 15:31:35 2016 Return-Path: Delivered-To: freebsd-geom@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 A3312B84642 for ; Sat, 9 Jul 2016 15:31:35 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 405421543; Sat, 9 Jul 2016 15:31:35 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from localhost (unknown [204.8.219.11]) by mail.dawidek.net (Postfix) with ESMTPSA id 55904D97; Sat, 9 Jul 2016 17:22:44 +0200 (CEST) Date: Sat, 9 Jul 2016 17:22:43 +0200 From: Pawel Jakub Dawidek To: Allan Jude Cc: Dexuan Cui , "Andrey V. Elsukov" , "freebsd-geom@freebsd.org" , Sepherosa Ziehau , sobomax , imp , ken , Hongjiang Zhang Subject: Re: How to force GEOM to recalculate the free space after the disk is resized? Message-ID: <20160709152243.GC95125@garage.freebsd.pl> References: <577FE380.8020601@yandex.ru> <81898d87-3413-d7a4-9462-069567a69701@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: <81898d87-3413-d7a4-9462-069567a69701@freebsd.org> X-OS: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2016 15:31:35 -0000 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 09, 2016 at 11:07:22AM -0400, Allan Jude wrote: > On 2016-07-08 22:32, Dexuan Cui wrote: > >> From: Andrey V. Elsukov [mailto:bu7cher@yandex.ru] > >> Sent: Saturday, July 9, 2016 1:32 > >> To: Dexuan Cui ; freebsd-geom@freebsd.org > >> Cc: sobomax ; Sepherosa Ziehau > >> ; ken ; Allan Jude > >> ; Hongjiang Zhang ; imp > >> > >> Subject: Re: How to force GEOM to recalculate the free space after the= disk is > >> resized? > >> > >> On 08.07.16 15:19, Dexuan Cui via freebsd-geom wrote: > >>> I'm not familiar with GEOM. Can somebody please explain the > >>> behavior? > >>> > >> > >> What FreeBSD version do you use? > >> What messages do you see in the console/dmesg after resizing of disk? > >> > >> WBR, Andrey V. Elsukov > >=20 > > I'm using 11-CURRENT, but I also tried 10.3 and got the same result. > >=20 > > I'm using verbose krenel message but I only see such a line on the first > > "diskinfo /dev/da1": WARNING: Disk drive da1 has no d_delmaxsize > >=20 > > If I use "sysctl kern.geom.debugflags=3D253" (log everything except G_T= _BIO), I get > > the below very verbose output FYI: > >=20 > > Dexuan: after the disk capacity change, this is for the first "diskinf= o /dev/da1". > > 1 g_dev_open(da1, 1, 8192, 0xfffff80111d95000) > > 2 g_access(0xfffff80004c92880(da1), 1, 0, 0) > > 3 open delta:[r1w0e0] old:[r0w0e0] provider:[r0w0e0] 0xfffff80004a635= 00(da1) > > 4 g_disk_access(da1, 1, 0, 0) > > 5 g_post_event_x(0xffffffff80996bb0, 0xfffff8001369e400, 1, 0) > > 6 WARNING: Disk drive da1 has no d_delmaxsize > > 7 g_dev_close(da1, 131073, 8192, 0xfffff80111d95000) > > 8 g_access(0xfffff80004c92880(da1), -1, 0, 0) > > 9 open delta:[r-1w0e0] old:[r1w0e0] provider:[r1w0e0] 0xfffff80004a63= 500(da1) > > 10 g_disk_access(da1, -1, 0, 0) > > 11 > >=20 > > Dexuan: this is for the second "diskinfo /dev/da1". > > 12 > > 13 g_dev_open(da1, 1, 8192, 0xfffff80111d95500) > > 14 g_access(0xfffff80004c92880(da1), 1, 0, 0) > > 15 open delta:[r1w0e0] old:[r0w0e0] provider:[r0w0e0] 0xfffff80004a635= 00(da1) > > 16 g_disk_access(da1, 1, 0, 0) > > 17 g_post_event_x(0xffffffff80996bb0, 0xfffff8001369e400, 1, 0) > > 18 g_dev_close(da1, 131073, 8192, 0xfffff80111d95500) > > 19 g_access(0xfffff80004c92880(da1), -1, 0, 0) > > 20 open delta:[r-1w0e0] old:[r1w0e0] provider:[r1w0e0] 0xfffff80004a63= 500(da1) >=20 > I don't think any of the r/w/e numbers should ever be able to go > negative. I am just guessing, but might be related to the problem. They don't go negative. By doing g_access(prov, -1, 0, 0) you simply close read access to the provider. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --T4sUOijqQbZv57TR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJXgRbDAAoJEJVLhSuxKFt1j0gQAMu/CL9tfEJ9ZMvoT4woBK88 6k/+qRxVNpJdEU/Dlyhas5Q5c47KzqlOaFNGBwPN2nyCcgLU7kELMLiWo/KZigrv GnssRX2S4+odPEAvx0Y2ooHDOu88kjK3XfjcF0mIMyX9OZSk3ZLjoaAh2diqxpnl 1QL3TkRB0HFJcnaRvhpTmOePHw5/27Zv+2J65sTfN/3zP92sDSe+UH1S44wj+p2V QOFS9pHqemeIQr/Ht4BjsQdQfroLG+0XEXVuOI8IRvq0qOx6BAl/th+t7HGAlDCo 7rfwzodl8hSiGHVflPHzSDY7iVOz4+tUCnTPpCFuHAAbxsMfIMWs2LNQXOO9hlSu jW8G3KKl5A4HYJ8REcMhUIVmjVSd8ZDUM3L1QbmTI//dV4y4/rY3XXsiGuQuowbk qi1+fYJ5P9N4mfFe77L0fUt1l/KTMkL3JvGqU66bnHimNFjo+Yd8/qSQeJS7Y41n hsNoAvw0Z11uTeqqpn2xJZc5uN+s+WxTFM5RUayOV1GktOgx4RQ0XgoSjm8b4GXp iQriwUoYpqJIVA4xHG6Ytej1IFAC34uxdab/0ksnkczDFDPX82LniGszq019srfW 3p46XzMVIbrOumCe7yHmOuFV3L5k56fH4XRojFDLckT0KhXmdbOulVijeDdeuk2Y 91jvKxzax/jNx2l4F5m0 =ozNL -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR--