From owner-svn-src-stable-9@freebsd.org Sun May 7 20:32:09 2017 Return-Path: Delivered-To: svn-src-stable-9@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 1A314D5326C; Sun, 7 May 2017 20:32:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 BD9C03DB; Sun, 7 May 2017 20:32:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v47KW7oY029601; Sun, 7 May 2017 20:32:07 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v47KW75P029600; Sun, 7 May 2017 20:32:07 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201705072032.v47KW75P029600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 7 May 2017 20:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r317918 - stable/9/sys/fs/nfsserver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 May 2017 20:32:09 -0000 Author: rmacklem Date: Sun May 7 20:32:07 2017 New Revision: 317918 URL: https://svnweb.freebsd.org/changeset/base/317918 Log: MFC: r317236 Fix the setting of atime for Linux client NFSv4 mounts. The FreeBSD NFSv4 server did not set the attribute bit for TimeAccess in the reply to an Open with exclusive_create, as required by the RFCs. (This is required since the FreeBSD NFS server stores the create_verifier in the va_atime attribute.) As such, the Linux NFSv4 client did not set the TimeAccess (atime) in the Setattr done in an RPC after the one with the Open/exclusive_create. This patch fixes the server to set the TimeAccess bit in the reply. I believe that storing the create_verifier in an extended attribute for file systems that support extended attributes might be a good idea, but I will wait for a discussion of this on the freebsd-fs@ email list before considering committing a patch to do this. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sun May 7 20:21:59 2017 (r317917) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sun May 7 20:32:07 2017 (r317918) @@ -1422,7 +1422,9 @@ nfsvno_open(struct nfsrv_descript *nd, s vput(ndp->ni_vp); ndp->ni_vp = NULL; nd->nd_repstat = NFSERR_NOTSUPP; - } + } else + NFSSETBIT_ATTRBIT(attrbitp, + NFSATTRBIT_TIMEACCESS); } else { nfsrv_fixattr(nd, ndp->ni_vp, nvap, aclp, p, attrbitp, exp); From owner-svn-src-stable-9@freebsd.org Mon May 8 22:44:18 2017 Return-Path: Delivered-To: svn-src-stable-9@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 AE9D3D6370C; Mon, 8 May 2017 22:44:18 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 544A61AAD; Mon, 8 May 2017 22:44:18 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v48MiHdA093545; Mon, 8 May 2017 22:44:17 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v48MiHeZ093541; Mon, 8 May 2017 22:44:17 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201705082244.v48MiHeZ093541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 8 May 2017 22:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r317992 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 22:44:18 -0000 Author: davidcs Date: Mon May 8 22:44:16 2017 New Revision: 317992 URL: https://svnweb.freebsd.org/changeset/base/317992 Log: MFC r317180 Cleanup QLA_LOCK/QLA_UNLOCK macros remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros format qla_error_recovery() Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_os.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.c Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Mon May 8 22:44:16 2017 (r317992) @@ -183,9 +183,9 @@ qla_sysctl_stop_pegs(SYSCTL_HANDLER_ARGS if (ret == 1) { ha = (qla_host_t *)arg1; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_stop_pegs(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } return err; Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ioctl.c Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_ioctl.c Mon May 8 22:44:16 2017 (r317992) @@ -233,10 +233,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, break; } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (!ha->hw.mdump_done) ha->qla_initiate_recovery = 1; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); #define QLNX_DUMP_WAIT_SECS 30 @@ -254,9 +254,9 @@ ql_eioctl(struct cdev *dev, u_long cmd, break; } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); ha->hw.mdump_done = 0; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if ((rval = copyout(ha->hw.mdump_template, fw_dump->minidump, ha->hw.mdump_template_size))) { Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_os.c Mon May 8 22:44:16 2017 (r317992) @@ -519,9 +519,9 @@ qla_pci_detach(device_t dev) ifp = ha->ifp; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_stop(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); qla_release(ha); @@ -895,9 +895,9 @@ qla_init(void *arg) QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_init_locked(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } @@ -929,13 +929,9 @@ qla_set_multi(qla_host_t *ha, uint32_t a if_maddr_runlock(ifp); - //if (QLA_LOCK(ha, __func__, 1) == 0) { - // ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - // QLA_UNLOCK(ha, __func__); - //} - QLA_LOCK(ha, __func__, 1); + QLA_LOCK(ha); ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); return (ret); } @@ -958,9 +954,9 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_init_locked(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", @@ -980,10 +976,12 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, if (ifr->ifr_mtu > QLA_MAX_MTU) { ret = EINVAL; } else { - (void) QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + ifp->if_mtu = ifr->ifr_mtu; ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { ret = ql_set_max_mtu(ha, ha->max_frame_size, ha->hw.rcv_cntxt_id); @@ -995,7 +993,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, ha->std_replenish = QL_STD_REPLENISH_THRES; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if (ret) ret = EINVAL; @@ -1007,7 +1005,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFFLAGS (0x%lx)\n", __func__, cmd)); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { @@ -1031,7 +1029,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, ha->if_flags = ifp->if_flags; } - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); break; case SIOCADDMULTI: @@ -1938,7 +1936,7 @@ qla_error_recovery(void *context, int pe struct ifnet *ifp = ha->ifp; int i = 0; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (ha->flags.qla_interface_up) { @@ -1964,7 +1962,7 @@ qla_error_recovery(void *context, int pe } } - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if ((ha->pci_func & 0x1) == 0) { @@ -1978,18 +1976,22 @@ qla_error_recovery(void *context, int pe ha->msg_from_peer = 0; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + ql_minidump(ha); - QLA_UNLOCK(ha, __func__); + + QLA_UNLOCK(ha); (void) ql_init_hw(ha); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + if (ha->flags.qla_interface_up) { - qla_free_xmt_bufs(ha); - qla_free_rcv_bufs(ha); + qla_free_xmt_bufs(ha); + qla_free_rcv_bufs(ha); } - QLA_UNLOCK(ha, __func__); + + QLA_UNLOCK(ha); qla_send_msg_to_peer(ha, QL_PEER_MSG_ACK); @@ -2009,39 +2011,43 @@ qla_error_recovery(void *context, int pe (void) ql_init_hw(ha); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + if (ha->flags.qla_interface_up) { - qla_free_xmt_bufs(ha); - qla_free_rcv_bufs(ha); - } - QLA_UNLOCK(ha, __func__); + qla_free_xmt_bufs(ha); + qla_free_rcv_bufs(ha); + } + + QLA_UNLOCK(ha); } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (ha->flags.qla_interface_up) { - if (qla_alloc_xmt_bufs(ha) != 0) { - QLA_UNLOCK(ha, __func__); - return; - } - qla_confirm_9kb_enable(ha); - if (qla_alloc_rcv_bufs(ha) != 0) { - QLA_UNLOCK(ha, __func__); - return; - } + if (qla_alloc_xmt_bufs(ha) != 0) { + QLA_UNLOCK(ha); + return; + } + qla_confirm_9kb_enable(ha); - ha->flags.stop_rcv = 0; - if (ql_init_hw_if(ha) == 0) { - ifp = ha->ifp; - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ha->flags.qla_watchdog_pause = 0; - } + if (qla_alloc_rcv_bufs(ha) != 0) { + QLA_UNLOCK(ha); + return; + } + + ha->flags.stop_rcv = 0; + + if (ql_init_hw_if(ha) == 0) { + ifp = ha->ifp; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ha->flags.qla_watchdog_pause = 0; + } } else ha->flags.qla_watchdog_pause = 0; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } static void @@ -2049,8 +2055,8 @@ qla_async_event(void *context, int pendi { qla_host_t *ha = context; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_hw_async_event(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } Modified: stable/9/sys/dev/qlxgbe/ql_os.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.h Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_os.h Mon May 8 22:44:16 2017 (r317992) @@ -147,12 +147,9 @@ MALLOC_DECLARE(M_QLA83XXBUF); /* * Locks */ -#define QLA_LOCK(ha, str, no_delay) mtx_lock(&ha->hw_lock) -#define QLA_UNLOCK(ha, str) mtx_unlock(&ha->hw_lock) +#define QLA_LOCK(ha) mtx_lock(&ha->hw_lock) +#define QLA_UNLOCK(ha) mtx_unlock(&ha->hw_lock) -#define QLA_TX_LOCK(ha) mtx_lock(&ha->tx_lock); -#define QLA_TX_UNLOCK(ha) mtx_unlock(&ha->tx_lock); - /* * structure encapsulating a DMA buffer */