Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jul 2016 17:22:43 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Allan Jude <allanjude@freebsd.org>
Cc:        Dexuan Cui <decui@microsoft.com>, "Andrey V. Elsukov" <bu7cher@yandex.ru>, "freebsd-geom@freebsd.org" <freebsd-geom@freebsd.org>, Sepherosa Ziehau <sepherosa@gmail.com>, sobomax <sobomax@FreeBSD.org>, imp <imp@FreeBSD.org>, ken <ken@FreeBSD.org>, Hongjiang Zhang <honzhan@microsoft.com>
Subject:   Re: How to force GEOM to recalculate the free space after the disk is resized?
Message-ID:  <20160709152243.GC95125@garage.freebsd.pl>
In-Reply-To: <81898d87-3413-d7a4-9462-069567a69701@freebsd.org>
References:  <CO2PR03MB2182532200F6E92F110EBAA1BF3C0@CO2PR03MB2182.namprd03.prod.outlook.com> <577FE380.8020601@yandex.ru> <CO2PR03MB21823EB65CFD865809C4E7BEBF3D0@CO2PR03MB2182.namprd03.prod.outlook.com> <81898d87-3413-d7a4-9462-069567a69701@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <decui@microsoft.com>; freebsd-geom@freebsd.org
> >> Cc: sobomax <sobomax@FreeBSD.org>; Sepherosa Ziehau
> >> <sepherosa@gmail.com>; ken <ken@FreeBSD.org>; Allan Jude
> >> <allanjude@freebsd.org>; Hongjiang Zhang <honzhan@microsoft.com>; imp
> >> <imp@FreeBSD.org>
> >> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160709152243.GC95125>