From nobody@FreeBSD.org  Tue Sep 14 11:38:44 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3901A106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Sep 2010 11:38:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 28DD38FC23
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Sep 2010 11:38:44 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8EBch8q000338
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 14 Sep 2010 11:38:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o8EBch78000331;
	Tue, 14 Sep 2010 11:38:43 GMT
	(envelope-from nobody)
Message-Id: <201009141138.o8EBch78000331@www.freebsd.org>
Date: Tue, 14 Sep 2010 11:38:43 GMT
From: Robert Schulze <rs@bytecamp.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gjournal unusable on GPT partitions
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         150555
>Category:       kern
>Synopsis:       [geom] gjournal unusable on GPT partitions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-geom
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 14 11:40:02 UTC 2010
>Closed-Date:    
>Last-Modified:  Wed Sep 15 17:24:22 UTC 2010
>Originator:     Robert Schulze
>Release:        8.1-STABLE
>Organization:
>Environment:
FreeBSD xxxxxx 8.1-STABLE FreeBSD 8.1-STABLE #5: Tue Sep  7 15:25:10 CEST 2010     root@xxxxxx:/usr/obj/usr/src/sys/VPOOL  amd64

>Description:
Enabling a gjournal on a GPT partitioned disk (da0 with da0p1) results in a journal not being able to disable. Without partitions (operating purely on da0), gjournal behaves correctly.

Furthermore, one may disable gjournal continously with two different provider names, without coming to an end:

# gjournal stop da0p1.journal
# gjournal list
ID: 1247948886
Providers:
1. Name: gptid/30da8781-bff2-11df-bbf1-001b21153950.journal
   Mediasize: 20401094144 (19G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: gptid/30da8781-bff2-11df-bbf1-001b21153950
   Mediasize: 21474836480 (20G)
   Sectorsize: 512
   Mode: r1w1e1
   Jend: 21474835968
   Jstart: 20401094144
   Role: Data,Journal

# gjournal stop gptid/30da8781-bff2-11df-bbf1-001b21153950.journal
# gjournal list
Geom name: gjournal 1247948886
ID: 1247948886
Providers:
1. Name: da0p1.journal
   Mediasize: 20401094144 (19G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: da0p1
   Mediasize: 21474836480 (20G)
   Sectorsize: 512
   Mode: r1w1e1
   Jend: 21474835968
   Jstart: 20401094144
   Role: Data,Journal

and so on.
>How-To-Repeat:
# gpart create -s GPT da0
# gpart add -t freebsd-ufs -s 20G da0
# gjournal label da0p1
# newfs -O 2 -J /dev/da0p1.journal
# mount /dev/da0p1.journal /mnt
# dd if=/dev/zero of=/mnt/file bs=1M count=1k
# umount /mnt
# gjournal sync
# gjournal stop da0p1.journal
# gjournal clear da0p1
Cannot clear metadata on da0p1: Operation not permitted.
gjournal: Not fully done.

>Fix:


>Release-Note:
>Audit-Trail:

From: "Andrey V. Elsukov" <bu7cher@yandex.ru>
To: Robert Schulze <rs@bytecamp.net>
Cc: freebsd-gnats-submit@FreeBSD.org, 
 Pawel Jakub Dawidek <pjd@FreeBSD.org>
Subject: Re: misc/150555: gjournal unusable on GPT partitions
Date: Wed, 15 Sep 2010 20:35:33 +0400

 On 14.09.2010 15:38, Robert Schulze wrote:
 > # gjournal stop da0p1.journal
 > # gjournal clear da0p1
 > Cannot clear metadata on da0p1: Operation not permitted.
 > gjournal: Not fully done.
 
 Hi,
 
 I think it is known problem, but i add pjd@ in CC.
 
 As quick and dirty hack you can disable glabel and after that
 you will be able to stop gjournal.
 Try this:
 # sysctl kern.geom.label.gpt.enable=0
 # sysctl kern.geom.label.gptid.enable=0
 # gjournal stop da0p1.journal
 
 -- 
 WBR, Andrey V. Elsukov
 
 -- 
 WBR, Andrey V. Elsukov
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: ae 
Responsible-Changed-When: Wed Sep 15 17:22:23 UTC 2010 
Responsible-Changed-Why:  
GEOM related. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=150555 
>Unformatted:
