Date: Sun, 28 May 2017 06:48:38 -0700 From: John Baldwin <jhb@freebsd.org> To: Konstantin Belousov <kib@freebsd.org> 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 Message-ID: <2187407.D9lHvpEUce@ralph.baldwin.cx> In-Reply-To: <201705271700.v4RH0USD004310@repo.freebsd.org> References: <201705271700.v4RH0USD004310@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2187407.D9lHvpEUce>