Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2012 18:40:39 GMT
From:      Oliver <grimeton@gmx.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/164254: GJournal not stopping on GPT partitions
Message-ID:  <201201171840.q0HIedH1009147@red.freebsd.org>
Resent-Message-ID: <201201171850.q0HIoBeo056295@freefall.freebsd.org>

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

>Number:         164254
>Category:       kern
>Synopsis:       GJournal not stopping on GPT partitions
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 17 18:50:11 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Oliver
>Release:        9.0-RELEASE
>Organization:
n/a
>Environment:
FreeBSD test 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
If you have a harddrive with GPT scheme and you use gjournal on one of the partitions, it switches between the "old" device name and the "new" gptid device name and you can't stop the journal on that device.

The system has a GPT partitioned drive:

# gpart show

=>       34  976773101  ada0  GPT  (465G)
         34  976773101     1  freebsd-ufs  (465G)
#

The filesystem on top is unmounted, but gjournal is still using it:
# mount
dev/ada1p2 on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)

# ls /dev/ada0*
/dev/ada0               /dev/ada0p1             /dev/ada0p1.journal

# gjournal list
Geom name: gjournal 2801902713
ID: 2801902713
Providers:
1. Name: ada0p1.journal
   Mediasize: 499034085376 (464G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ada0p1
   Mediasize: 500107827712 (465G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r1w1e1
   Jend: 500107827200
   Jstart: 499034085376
   Role: Data,Journal
#

Now, if I stop the provider or the consumer (doesn't matter):

# gjournal stop /dev/ada0p1

Then I can see that the journal is gone:

# ls /dev/ada0*
/dev/ada0       /dev/ada0p1

But if I try to remove the partiton:

# gpart delete -i 1 ada0
gpart: Device busy
#

it's still used, so checking what's going on in gjournal gives me

# gjournal list

Geom name: gjournal 2801902713
ID: 2801902713
Providers:
1. Name: gptid/f9074aa8-4113-11e1-b382-00301bbc854a.journal
   Mediasize: 499034085376 (464G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: gptid/f9074aa8-4113-11e1-b382-00301bbc854a
   Mediasize: 500107827712 (465G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r1w1e1
   Jend: 500107827200
   Jstart: 499034085376
   Role: Data,Journal

#

So stopping the journal on /dev/ada0p1 enabled the journal on /dev/gptid/f9074aa8-4113-11e1-b382-00301bbc854a which is the same drive:

# gpart list ada0
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 976773134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 500107827712 (465G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r1w1e2
   rawuuid: f9074aa8-4113-11e1-b382-00301bbc854a
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 500107827712
   offset: 17408
   type: freebsd-ufs
   index: 1
   end: 976773134
   start: 34
Consumers:
1. Name: ada0
   Mediasize: 500107862016 (465G)
   Sectorsize: 512
   Mode: r1w1e3
#

Now guess what happens if I stop the journal on /dev/gptid/f9074aa8-4113-11e1-b382-00301bbc854a

# gjournal stop /dev/gptid/f9074aa8-4113-11e1-b382-00301bbc854a
# gjournal list
Geom name: gjournal 2801902713
ID: 2801902713
Providers:
1. Name: ada0p1.journal
   Mediasize: 499034085376 (464G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ada0p1
   Mediasize: 500107827712 (465G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r1w1e1
   Jend: 500107827200
   Jstart: 499034085376
   Role: Data,Journal

Maybe it's not a bug and I'm missing something,but it's weird.

Thanks!

KR,

Grimeton
>How-To-Repeat:
- Install 9.0-Release
- On top of an empty harddrive create a GPT partitioning scheme with one partition
- Label the partition with gjournal
- create an UFS2 with journaling enabled on top of the journaled partition
- stop the journal on the "old" device name /dev/$diskp0
- check gjournal list and see the journal enabled on the same device under it's gptid-name
- disable the journal on the gptid-device and see it enabled on the "old" device again

>Fix:
No clue.

>Release-Note:
>Audit-Trail:
>Unformatted:



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