From owner-svn-src-head@freebsd.org Tue May 30 16:31:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 009ABB8768C; Tue, 30 May 2017 16:31:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2E416E1DF; Tue, 30 May 2017 16:31:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8ABAA10AFA2; Tue, 30 May 2017 12:31:12 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318997 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/nfsclient kern sys Date: Sun, 28 May 2017 06:48:38 -0700 Message-ID: <2187407.D9lHvpEUce@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201705271700.v4RH0USD004310@repo.freebsd.org> References: <201705271700.v4RH0USD004310@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 30 May 2017 12:31:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 16:31:14 -0000 On Saturday, May 27, 2017 05:00:30 PM Konstantin Belousov wrote: > Author: kib > Date: Sat May 27 17:00:30 2017 > New Revision: 318997 > URL: https://svnweb.freebsd.org/changeset/base/318997 > > Log: > Use whole mnt_stat.f_fsid bits for st_dev. > > Since ino64 expanded dev_t to 64bit, make VOP_GETATTR(9) provide all > bits of mnt_stat.f_fsid as va_fsid for vnodes on filesystems which use > f_fsid. In particular, NFSv3 and sometimes NFSv4, and ZFS use this > method or reporting st_dev by stat(2). > > Provide a new helper vn_fsid() to avoid duplicating code to copy > f_fsid to va_fsid. > > Note that the change is mostly cosmetic. Its motivation is to avoid > sign-extension of f_fsid[0] into 64bit dev_t value which happens after > dev_t becomes 64bit.. > > Reviewed by: avg(zfs), rmacklem (nfs) (both for previous version) > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > head/sys/fs/nfsclient/nfs_clport.c > head/sys/kern/vfs_vnops.c > head/sys/sys/vnode.h > > Modified: head/sys/fs/nfsclient/nfs_clport.c > ============================================================================== > --- head/sys/fs/nfsclient/nfs_clport.c Sat May 27 16:53:39 2017 (r318996) > +++ head/sys/fs/nfsclient/nfs_clport.c Sat May 27 17:00:30 2017 (r318997) > @@ -490,14 +490,13 @@ nfscl_loadattrcache(struct vnode **vpp, > * from the value used for the top level server volume > * in the mounted subtree. > */ > - if (vp->v_mount->mnt_stat.f_fsid.val[0] != > - (uint32_t)np->n_vattr.na_filesid[0]) > - vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0]; > - else > - vap->va_fsid = (uint32_t)hash32_buf( > + vn_fsid(vp, vap); > + vap->va_fsid = np->n_vattr.na_filesid[0]; > + if (vap->va_fsid == np->n_vattr.na_filesid[0]) > + vap->va_fsid = hash32_buf( > np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); Won't this always be true now since you've done 'a = b; if (a == b) ...'? Also, does the assignment to 'va_fsid' before the 'if' overwrite the work of vn_fsid()? -- John Baldwin