From owner-svn-src-head@freebsd.org Tue May 30 17:19:11 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 0A4F8B94213; Tue, 30 May 2017 17:19:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90DDD7086C; Tue, 30 May 2017 17:19:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v4UHJ59N055971 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 30 May 2017 20:19:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4UHJ59N055971 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4UHJ4YE055969; Tue, 30 May 2017 20:19:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 May 2017 20:19:04 +0300 From: Konstantin Belousov To: John Baldwin Cc: Rick Macklem , 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: <20170530171904.GL82323@kib.kiev.ua> References: <201705271700.v4RH0USD004310@repo.freebsd.org> <2187407.D9lHvpEUce@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2187407.D9lHvpEUce@ralph.baldwin.cx> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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 17:19:11 -0000 On Sun, May 28, 2017 at 06:48:38AM -0700, John Baldwin wrote: > On Saturday, May 27, 2017 05:00:30 PM Konstantin Belousov wrote: > > */ > > - 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()? Thank you. Indeed, the asignment should have been removed. Below is the proposed correction. diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 509c38b8614..44c0eae0179 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -491,8 +491,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper, * in the mounted subtree. */ vn_fsid(vp, vap); - vap->va_fsid = np->n_vattr.na_filesid[0]; - if (vap->va_fsid == np->n_vattr.na_filesid[0]) + if ((uint32_t)vap->va_fsid == np->n_vattr.na_filesid[0]) vap->va_fsid = hash32_buf( np->n_vattr.na_filesid, 2 * sizeof(uint64_t), 0); } else