Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jul 2016 02:32:31 +0000
From:      Dexuan Cui <decui@microsoft.com>
To:        "Andrey V. Elsukov" <bu7cher@yandex.ru>, "freebsd-geom@freebsd.org" <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?
Message-ID:  <CO2PR03MB21823EB65CFD865809C4E7BEBF3D0@CO2PR03MB2182.namprd03.prod.outlook.com>
In-Reply-To: <577FE380.8020601@yandex.ru>
References:  <CO2PR03MB2182532200F6E92F110EBAA1BF3C0@CO2PR03MB2182.namprd03.prod.outlook.com> <577FE380.8020601@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 di=
sk is
> resized?
>=20
> On 08.07.16 15:19, Dexuan Cui via freebsd-geom wrote:
> > I'm not familiar with GEOM. Can somebody please explain the
> > behavior?
> >
>=20
> What FreeBSD version do you use?
> What messages do you see in the console/dmesg after resizing of disk?
>=20
> WBR, Andrey V. Elsukov

I'm using 11-CURRENT, but I also tried 10.3 and got the same result.

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

If I use "sysctl kern.geom.debugflags=3D253" (log everything except G_T_BIO=
), I get
the below very verbose output FYI:

Dexuan: after the  disk capacity change, this is for the first "diskinfo /d=
ev/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] 0xfffff80004a63500(d=
a1)
  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] 0xfffff80004a63500(=
da1)
 10 g_disk_access(da1, -1, 0, 0)
 11

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] 0xfffff80004a63500(d=
a1)
 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] 0xfffff80004a63500(=
da1)
 21 g_disk_access(da1, -1, 0, 0)
 22

Dexuan: after disk capacity change, this is for the first "gpart show /dev/=
da1":
the new free space is not detected, though the new disk capacity is detecte=
d.
 23
 24 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 25 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 26 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 27 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 28

Dexuan: this is for the=20
openat(AT_FDCWD,"/dev/da1",O_WRONLY|O_CREAT,0644);":
 29
 30 g_dev_open(da1, 2, 8192, 0xfffff80111d95500)
 31 g_access(0xfffff80004c92880(da1), 0, 1, 0)
 32 open delta:[r0w1e0] old:[r0w0e0] provider:[r0w0e0] 0xfffff80004a63500(d=
a1)
 33 g_disk_access(da1, 0, 1, 0)
 34 g_post_event_x(0xffffffff80996bb0, 0xfffff8001369e400, 1, 0)
 35 g_post_event_x(0xffffffff8099e760, 0xfffff80004a63500, 2, 0)
 36   ref 0xfffff80004a63500
 37 g_spoil_event 0xfffff80004a63500(DISK:da1:da1)
 38 g_part_spoiled(da1)
 39 g_wither_geom(0xfffff802693bc700(da1))
 40 g_detach(0xfffff80004c92800)
 41 g_destroy_consumer(0xfffff80004c92800)
 42 g_destroy_geom(0xfffff802693bc700(da1))
 43 g_dev_close(da1, 131074, 8192, 0xfffff80111d95500)
 44 g_access(0xfffff80004c92880(da1), 0, -1, 0)
 45 open delta:[r0w-1e0] old:[r0w1e0] provider:[r0w1e0] 0xfffff80004a63500(=
da1)
 46 g_disk_access(da1, 0, -1, 0)
 47 g_post_event_x(0xffffffff8099db70, 0xfffff80004a63500, 2, 0)
 48   ref 0xfffff80004a63500
 49 g_raid_taste(RAID, da1)
 50 g_attach(0xfffff80004c92800, 0xfffff80004a63500)
 51 g_access(0xfffff80004c92800(da1), 1, 0, 0)
 52 open delta:[r1w0e0] old:[r0w0e0] provider:[r0w0e0] 0xfffff80004a63500(d=
a1)
 53 g_disk_access(da1, 1, 0, 0)
 54 g_post_event_x(0xffffffff80996bb0, 0xfffff8001369e400, 1, 0)
 55 g_access(0xfffff80004c92800(da1), -1, 0, 0)
 56 open delta:[r-1w0e0] old:[r1w0e0] provider:[r1w0e0] 0xfffff80004a63500(=
da1)
 57 g_disk_access(da1, -1, 0, 0)
 58 g_detach(0xfffff80004c92800)
 59 g_destroy_consumer(0xfffff80004c92800)
 60 g_destroy_geom(0xfffff80269439400(raid:taste))
 61 g_label_taste(LABEL, da1)
 62 g_attach(0xfffff80004c92800, 0xfffff80004a63500)
 63 g_access(0xfffff80004c92800(da1), 1, 0, 0)
 64 open delta:[r1w0e0] old:[r0w0e0] provider:[r0w0e0] 0xfffff80004a63500(d=
a1)
 65 g_disk_access(da1, 1, 0, 0)
 66 g_post_event_x(0xffffffff80996bb0, 0xfffff8001369e400, 1, 0)
 67 g_access(0xfffff80004c92800(da1), -1, 0, 0)
 68 open delta:[r-1w0e0] old:[r1w0e0] provider:[r1w0e0] 0xfffff80004a63500(=
da1)
 69 g_disk_access(da1, -1, 0, 0)
 70 g_detach(0xfffff80004c92800)
 71 g_destroy_consumer(0xfffff80004c92800)
 72 g_destroy_geom(0xfffff80269439400(label:taste))
 73 g_part_taste(PART,da1)
 74 g_attach(0xfffff80004c92800, 0xfffff80004a63500)
 75 g_access(0xfffff80004c92800(da1), 1, 0, 0)
 76 open delta:[r1w0e0] old:[r0w0e0] provider:[r0w0e0] 0xfffff80004a63500(d=
a1)
 77 g_disk_access(da1, 1, 0, 0)
 78 g_post_event_x(0xffffffff80996bb0, 0xfffff8001369e400, 1, 0)
 79 g_access(0xfffff80004c92800(da1), -1, 0, 0)
 80 open delta:[r-1w0e0] old:[r1w0e0] provider:[r1w0e0] 0xfffff80004a63500(=
da1)
 81 g_disk_access(da1, -1, 0, 0)
 81 g_disk_access(da1, -1, 0, 0)

Dexuan: this is for the second "gpart show /dev/da1": the new free space is
detected:
 82
 83 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 84 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 85 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144)
 86 g_post_event_x(0xffffffff80998520, 0xfffff800043942c0, 2, 262144


Thanks,
-- Dexuan




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