From nobody@FreeBSD.org  Sun Dec  2 23:47:22 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 1799A351
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Dec 2012 23:47:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id F2F188FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Dec 2012 23:47:21 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qB2NlLVN083487
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 2 Dec 2012 23:47:21 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qB2NlLNd083486;
	Sun, 2 Dec 2012 23:47:21 GMT
	(envelope-from nobody)
Message-Id: <201212022347.qB2NlLNd083486@red.freebsd.org>
Date: Sun, 2 Dec 2012 23:47:21 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch][zfs] the birthtime is always set for st_ctime when getting a file's attributes
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174067
>Category:       kern
>Synopsis:       [patch][zfs] the birthtime is always set for st_ctime when getting a file's attributes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 02 23:50:00 UTC 2012
>Closed-Date:    Mon Dec 31 07:13:32 UTC 2012
>Last-Modified:  Sun Feb 03 22:31:43 UTC 2013
>Originator:     Garrett Cooper
>Release:        9-STABLE
>Organization:
EMC Isilon
>Environment:
FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat Sep 22 12:30:11 PDT 2012     gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
>Description:
As noted by the submitter [1], the crtime attribute is always being incorrectly set to the CTIME (changetime) value.

This regression was committed in the ZFS v28 import [2].

The attached patch fixes the issue.

1. http://lists.freebsd.org/pipermail/freebsd-fs/2012-December/015860.html
2. http://svnweb.freebsd.org/base?view=revision&revision=219089
>How-To-Repeat:
- Create a file.
- Change the file.

Note that the birth time changes for the file.
>Fix:


Patch attached with submission follows:

Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	(revision 243557)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	(working copy)
@@ -2669,7 +2669,7 @@
 
 	SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), NULL, &mtime, 16);
 	SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &ctime, 16);
-	SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &crtime, 16);
+	SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CRTIME(zfsvfs), NULL, &crtime, 16);
 	if (vp->v_type == VBLK || vp->v_type == VCHR)
 		SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_RDEV(zfsvfs), NULL,
 		    &rdev, 8);


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: delphij 
State-Changed-When: Mon Dec 3 05:02:27 UTC 2012 
State-Changed-Why:  
Mark as patched, pending MFC. 


Responsible-Changed-From-To: freebsd-bugs->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Mon Dec 3 05:02:27 UTC 2012 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174067 
State-Changed-From-To: patched->closed 
State-Changed-By: delphij 
State-Changed-When: Mon Dec 31 07:12:07 UTC 2012 
State-Changed-Why:  
MFC'ed to 9-STABLE and 8-STABLE. 

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