From nobody@FreeBSD.org  Sat Jul 17 10:58:42 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 10AD61065676
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 17 Jul 2010 10:58:42 +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 F3C6B8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 17 Jul 2010 10:58:41 +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 o6HAwf6c045128
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 17 Jul 2010 10:58:41 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o6HAwfJ3045127;
	Sat, 17 Jul 2010 10:58:41 GMT
	(envelope-from nobody)
Message-Id: <201007171058.o6HAwfJ3045127@www.freebsd.org>
Date: Sat, 17 Jul 2010 10:58:41 GMT
From: Shigeya Suzuki <shigeya@wide.ad.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: running du with zfs filesystem with sharesmb=on cause panic zfs_fuid_map_id 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         148709
>Category:       kern
>Synopsis:       [zfs] [panic] running du with zfs filesystem with sharesmb=on cause panic zfs_fuid_map_id
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    mm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 17 11:00:15 UTC 2010
>Closed-Date:    Wed Sep 15 16:52:56 UTC 2010
>Last-Modified:  Wed Sep 15 16:52:56 UTC 2010
>Originator:     Shigeya Suzuki
>Release:        8.1-RC2
>Organization:
Keio University
>Environment:
FreeBSD XXXXXXX 8.1-RC2 FreeBSD 8.1-RC2 #0: Tue Jun 29 20:21:55 UTC 2010     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Importing a ZFS pool created by OpenSolaris with filesystems enabling sharesmb, then running "du" on the filesystem causes panic: zfs_fuid_map_id.

This looks like simliar to:
kern/145778: [zfs] [panic] panic in zfs_fuid_map_id (known issue fixed in opensolaris)

>How-To-Repeat:
Create a ZFS pool on OpenSolaris (2009.06)  (zfs v14).
Create a filesystem.
set sharesmb=ON

import the ZFS pool on FreeBSD
run "du" on the mounted filesystem, which attribute has "sharesmb=ON" 
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jul 17 19:53:53 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148709 

From: Shigeya Suzuki <shigeya@wide.ad.jp>
To: bug-followup@FreeBSD.org, shigeya@wide.ad.jp
Cc:  
Subject: Re: kern/148709: [zfs] [panic] running du with zfs filesystem with
 sharesmb=on cause panic zfs_fuid_map_id
Date: Thu, 22 Jul 2010 13:08:45 +0900

 I forgot to mention that, the current 'zfs' command does not allow to
 modify sharesmb attribute.
 
 Thus, if user want to turn off sharesmb attribute, he have to boot from
 OpenSolaris to do so. While it may be possible, not easy to fix this,
 especially if there are lot of filesystems with sharesmb=on.

From: Martin Matuska <mm@FreeBSD.org>
To: bug-followup@FreeBSD.org, shigeya@wide.ad.jp
Cc:  
Subject: Re: kern/148709: [zfs] [panic] running du with zfs filesystem with
 sharesmb=on cause panic zfs_fuid_map_id
Date: Thu, 22 Jul 2010 10:54:49 +0200

  Can you reproduce this with the latest ZFS v15 code?
 You can try to boot using the ISO file found at: http://mfsbsd.vx.sk/

From: Shigeya Suzuki <shigeya@wide.ad.jp>
To: Martin Matuska <mm@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/148709: [zfs] [panic] running du with zfs filesystem with
 sharesmb=on cause panic zfs_fuid_map_id
Date: Thu, 22 Jul 2010 20:48:09 +0900

 I still have the box I used for test as is. I will try tonight, if possible.

From: Shigeya Suzuki <shigeya@wide.ad.jp>
To: Martin Matuska <mm@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/148709: [zfs] [panic] running du with zfs filesystem with
 sharesmb=on cause panic zfs_fuid_map_id
Date: Thu, 22 Jul 2010 23:38:26 +0900

 Tested. Gotten same panic: "zfs_fuid_map_id"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148709: commit references a PR
Date: Thu, 22 Jul 2010 23:30:36 +0000 (UTC)

 Author: mm
 Date: Thu Jul 22 23:30:24 2010
 New Revision: 210398
 URL: http://svn.freebsd.org/changeset/base/210398
 
 Log:
   Enable fake resolving of SMB RIDs by using nulldomain and UID_NOBODY
   - fixes panics when Solaris/OpenSolaris pools that contain files
   uploaded with the SMB protocol are accessed
   
   Enable seting/unsetting the sharesmb property (dummy action)
   - allows users who import pools from Solaris/Opensolaris to unset
   the sharesmb property and get rid of annoying messages
   
   PR:		kern/145778, kern/148709
   Approved by:	pjd, delphij (mentor)
   MFC after:	7 weeks
 
 Modified:
   head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c
 
 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
 ==============================================================================
 --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Thu Jul 22 23:23:39 2010	(r210397)
 +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Thu Jul 22 23:30:24 2010	(r210398)
 @@ -1265,7 +1265,6 @@ zfs_prop_set(zfs_handle_t *zhp, const ch
  	case ZFS_PROP_XATTR:
  	case ZFS_PROP_VSCAN:
  	case ZFS_PROP_NBMAND:
 -	case ZFS_PROP_SHARESMB:
  		(void) snprintf(errbuf, sizeof (errbuf),
  		    "property '%s' not supported on FreeBSD", propname);
  		ret = zfs_error(hdl, EZFS_PERM, errbuf);
 
 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c
 ==============================================================================
 --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c	Thu Jul 22 23:23:39 2010	(r210397)
 +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c	Thu Jul 22 23:30:24 2010	(r210398)
 @@ -410,7 +410,7 @@ zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64
  	domain = zfs_fuid_find_by_idx(zfsvfs, index);
  	ASSERT(domain != NULL);
  
 -#ifdef TODO
 +#ifdef sun
  	if (type == ZFS_OWNER || type == ZFS_ACE_USER) {
  		(void) kidmap_getuidbysid(crgetzone(cr), domain,
  		    FUID_RID(fuid), &id);
 @@ -418,9 +418,9 @@ zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64
  		(void) kidmap_getgidbysid(crgetzone(cr), domain,
  		    FUID_RID(fuid), &id);
  	}
 -#else
 -	panic(__func__);
 -#endif
 +#else	/* sun */
 +	id = UID_NOBODY;
 +#endif	/* sun */
  	return (id);
  }
  
 @@ -514,21 +514,21 @@ zfs_fuid_create_cred(zfsvfs_t *zfsvfs, z
  	if (!zfsvfs->z_use_fuids || !IS_EPHEMERAL(id))
  		return ((uint64_t)id);
  
 -#ifdef TODO
 +#ifdef sun
  	ksid = crgetsid(cr, (type == ZFS_OWNER) ? KSID_OWNER : KSID_GROUP);
  
  	VERIFY(ksid != NULL);
  	rid = ksid_getrid(ksid);
  	domain = ksid_getdomain(ksid);
 -
 +#else	/* sun */
 +	rid = UID_NOBODY;
 +	domain = nulldomain;
 +#endif	/* sun */
  	idx = zfs_fuid_find_by_domain(zfsvfs, domain, &kdomain, B_TRUE);
  
  	zfs_fuid_node_add(fuidp, kdomain, rid, idx, id, type);
  
  	return (FUID_ENCODE(idx, rid));
 -#else
 -	panic(__func__);
 -#endif
  }
  
  /*
 @@ -597,7 +597,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64
  		};
  		domain = fuidp->z_domain_table[idx -1];
  	} else {
 -#ifdef TODO
 +#ifdef sun
  		if (type == ZFS_OWNER || type == ZFS_ACE_USER)
  			status = kidmap_getsidbyuid(crgetzone(cr), id,
  			    &domain, &rid);
 @@ -606,6 +606,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64
  			    &domain, &rid);
  
  		if (status != 0) {
 +#endif	/* sun */
  			/*
  			 * When returning nobody we will need to
  			 * make a dummy fuid table entry for logging
 @@ -613,10 +614,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64
  			 */
  			rid = UID_NOBODY;
  			domain = nulldomain;
 +#ifdef sun
  		}
 -#else
 -		panic(__func__);
 -#endif
 +#endif	/* sun */
  	}
  
  	idx = zfs_fuid_find_by_domain(zfsvfs, domain, &kdomain, B_TRUE);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: Shigeya Suzuki <shigeya@wide.ad.jp>
To: bug-followup@FreeBSD.org, shigeya@wide.ad.jp
Cc:  
Subject: Re: kern/148709: [zfs] [panic] running du with zfs filesystem with
 sharesmb=on cause panic zfs_fuid_map_id
Date: Mon, 02 Aug 2010 06:02:21 +0900

 Same reason, different usage caused panic: I'm now trying to "zfs send -
 zfs recv" from OpenSolaris file system onto FreeBSD box. This also cause
 same panic, when there is a filesystem which has sharesmb=ON.
 
 I will test the proposed patch.
 
 

From: Shigeya Suzuki <shigeya@wide.ad.jp>
To: bug-followup@FreeBSD.org, shigeya@wide.ad.jp
Cc:  
Subject: Re: kern/148709: [zfs] [panic] running du with zfs filesystem with
 sharesmb=on cause panic zfs_fuid_map_id
Date: Tue, 03 Aug 2010 21:16:01 +0900

 I have applied the patch, and tested it with "zfs send" from OpenSolaris
 box (zfs v13) into "ssh zfs recv" (FreeBSD 8.1)
 It looks like working fine.
 
Responsible-Changed-From-To: freebsd-fs->mm 
Responsible-Changed-By: mm 
Responsible-Changed-When: Wed Aug 4 07:18:37 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148709 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/148709: commit references a PR
Date: Wed, 15 Sep 2010 16:10:51 +0000 (UTC)

 Author: mm
 Date: Wed Sep 15 16:10:38 2010
 New Revision: 212670
 URL: http://svn.freebsd.org/changeset/base/212670
 
 Log:
   MFC r210398:
   
   Enable fake resolving of SMB RIDs by using nulldomain and UID_NOBODY
   - fixes panics when Solaris/OpenSolaris pools that contain files
   uploaded with the SMB protocol are accessed
   
   Enable seting/unsetting the sharesmb property (dummy action)
   - allows users who import pools from Solaris/Opensolaris to unset
   the sharesmb property and get rid of annoying messages
   
   PR:		kern/145778, kern/148709
   Approved by:	pjd, delphij (mentor))
 
 Modified:
   stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
   stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c
 Directory Properties:
   stable/8/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
 ==============================================================================
 --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Wed Sep 15 16:05:51 2010	(r212669)
 +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Wed Sep 15 16:10:38 2010	(r212670)
 @@ -1265,7 +1265,6 @@ zfs_prop_set(zfs_handle_t *zhp, const ch
  	case ZFS_PROP_XATTR:
  	case ZFS_PROP_VSCAN:
  	case ZFS_PROP_NBMAND:
 -	case ZFS_PROP_SHARESMB:
  		(void) snprintf(errbuf, sizeof (errbuf),
  		    "property '%s' not supported on FreeBSD", propname);
  		ret = zfs_error(hdl, EZFS_PERM, errbuf);
 
 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c
 ==============================================================================
 --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c	Wed Sep 15 16:05:51 2010	(r212669)
 +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c	Wed Sep 15 16:10:38 2010	(r212670)
 @@ -410,7 +410,7 @@ zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64
  	domain = zfs_fuid_find_by_idx(zfsvfs, index);
  	ASSERT(domain != NULL);
  
 -#ifdef TODO
 +#ifdef sun
  	if (type == ZFS_OWNER || type == ZFS_ACE_USER) {
  		(void) kidmap_getuidbysid(crgetzone(cr), domain,
  		    FUID_RID(fuid), &id);
 @@ -418,9 +418,9 @@ zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64
  		(void) kidmap_getgidbysid(crgetzone(cr), domain,
  		    FUID_RID(fuid), &id);
  	}
 -#else
 -	panic(__func__);
 -#endif
 +#else	/* sun */
 +	id = UID_NOBODY;
 +#endif	/* sun */
  	return (id);
  }
  
 @@ -514,21 +514,21 @@ zfs_fuid_create_cred(zfsvfs_t *zfsvfs, z
  	if (!zfsvfs->z_use_fuids || !IS_EPHEMERAL(id))
  		return ((uint64_t)id);
  
 -#ifdef TODO
 +#ifdef sun
  	ksid = crgetsid(cr, (type == ZFS_OWNER) ? KSID_OWNER : KSID_GROUP);
  
  	VERIFY(ksid != NULL);
  	rid = ksid_getrid(ksid);
  	domain = ksid_getdomain(ksid);
 -
 +#else	/* sun */
 +	rid = UID_NOBODY;
 +	domain = nulldomain;
 +#endif	/* sun */
  	idx = zfs_fuid_find_by_domain(zfsvfs, domain, &kdomain, B_TRUE);
  
  	zfs_fuid_node_add(fuidp, kdomain, rid, idx, id, type);
  
  	return (FUID_ENCODE(idx, rid));
 -#else
 -	panic(__func__);
 -#endif
  }
  
  /*
 @@ -597,7 +597,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64
  		};
  		domain = fuidp->z_domain_table[idx -1];
  	} else {
 -#ifdef TODO
 +#ifdef sun
  		if (type == ZFS_OWNER || type == ZFS_ACE_USER)
  			status = kidmap_getsidbyuid(crgetzone(cr), id,
  			    &domain, &rid);
 @@ -606,6 +606,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64
  			    &domain, &rid);
  
  		if (status != 0) {
 +#endif	/* sun */
  			/*
  			 * When returning nobody we will need to
  			 * make a dummy fuid table entry for logging
 @@ -613,10 +614,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64
  			 */
  			rid = UID_NOBODY;
  			domain = nulldomain;
 +#ifdef sun
  		}
 -#else
 -		panic(__func__);
 -#endif
 +#endif	/* sun */
  	}
  
  	idx = zfs_fuid_find_by_domain(zfsvfs, domain, &kdomain, B_TRUE);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: mm 
State-Changed-When: Wed Sep 15 16:52:55 UTC 2010 
State-Changed-Why:  
Resolved. Thanks! 

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