From owner-svn-src-stable-10@freebsd.org Mon Jul 16 00:28:35 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 032911031D7A; Mon, 16 Jul 2018 00:28:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A43E6772DD; Mon, 16 Jul 2018 00:28:34 +0000 (UTC) (envelope-from pfg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A9D31534D; Mon, 16 Jul 2018 00:28:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6G0SYmT003096; Mon, 16 Jul 2018 00:28:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6G0SYXn003095; Mon, 16 Jul 2018 00:28:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201807160028.w6G0SYXn003095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Jul 2018 00:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336324 - stable/10/lib/libiconv_modules/mapper_std X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/lib/libiconv_modules/mapper_std X-SVN-Commit-Revision: 336324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jul 2018 00:28:35 -0000 Author: pfg Date: Mon Jul 16 00:28:33 2018 New Revision: 336324 URL: https://svnweb.freebsd.org/changeset/base/336324 Log: MFC r336115; libiconv: correct undefined behavior. Detected on NetBSD: # nm /usr/lib/libc.so|grep sanit /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Obtained from: NetBSD (CVS Rev. 1.11) Modified: stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c ============================================================================== --- stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Mon Jul 16 00:23:09 2018 (r336323) +++ stable/10/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Mon Jul 16 00:28:33 2018 (r336324) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -159,7 +159,7 @@ rowcol_parse_variable_compat(struct _citrus_mapper_std rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid); rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits); m = be32toh(rcx->rcx_src_col_bits); - n = 1 << (m - 1); + n = 1U << (m - 1); n |= n - 1; rc->rc_src_rowcol_bits = m; rc->rc_src_rowcol_mask = n; From owner-svn-src-stable-10@freebsd.org Tue Jul 17 19:26:19 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40D96104BAF0; Tue, 17 Jul 2018 19:26:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6D58760A0; Tue, 17 Jul 2018 19:26:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACFD37C9B; Tue, 17 Jul 2018 19:26:18 +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 w6HJQINa032810; Tue, 17 Jul 2018 19:26:18 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6HJQIZS032808; Tue, 17 Jul 2018 19:26:18 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807171926.w6HJQIZS032808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 17 Jul 2018 19:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336422 - in stable/10/sys/fs: nfs nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/10/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 336422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2018 19:26:19 -0000 Author: rmacklem Date: Tue Jul 17 19:26:17 2018 New Revision: 336422 URL: https://svnweb.freebsd.org/changeset/base/336422 Log: MFC: r333645 End grace for the NFSv4 server if all mounts do ReclaimComplete. The NFSv4 protocol requires that the server only allow reclaim of state and not issue any new open/lock state for a grace period after booting. The NFSv4.0 protocol required this grace period to be greater than the lease duration (over 2minutes). For NFSv4.1, the client tells the server that it has done reclaiming state by doing a ReclaimComplete operation. If all NFSv4 clients are NFSv4.1, the grace period can end once all the clients have done ReclaimComplete, shortening the time period considerably. This patch does this. If there are any NFSv4.0 mounts, the grace period will still be over 2minutes. This change is only an optimization and does not affect correct operation. Modified: stable/10/sys/fs/nfs/nfsport.h stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfsport.h ============================================================================== --- stable/10/sys/fs/nfs/nfsport.h Tue Jul 17 19:10:15 2018 (r336421) +++ stable/10/sys/fs/nfs/nfsport.h Tue Jul 17 19:26:17 2018 (r336422) @@ -519,6 +519,7 @@ struct nfst_rec { #define NFSNST_NEWSTATE 0x1 #define NFSNST_REVOKE 0x2 #define NFSNST_GOTSTATE 0x4 +#define NFSNST_RECLAIMED 0x8 /* * This structure is linked onto nfsrv_stablefirst for the duration of Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jul 17 19:10:15 2018 (r336421) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jul 17 19:26:17 2018 (r336422) @@ -139,6 +139,7 @@ static int nfsrv_cbcallargs(struct nfsrv_descript *nd, static u_int32_t nfsrv_nextclientindex(void); static u_int32_t nfsrv_nextstateindex(struct nfsclient *clp); static void nfsrv_markstable(struct nfsclient *clp); +static void nfsrv_markreclaim(struct nfsclient *clp); static int nfsrv_checkstable(struct nfsclient *clp); static int nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, struct vnode *vp, NFSPROC_T *p); @@ -4087,8 +4088,27 @@ static int nfsrv_checkgrace(struct nfsrv_descript *nd, struct nfsclient *clp, u_int32_t flags) { - int error = 0; + int error = 0, notreclaimed; + struct nfsrv_stable *sp; + if ((nfsrv_stablefirst.nsf_flags & (NFSNSF_UPDATEDONE | + NFSNSF_GRACEOVER)) == 0) { + /* + * First, check to see if all of the clients have done a + * ReclaimComplete. If so, grace can end now. + */ + notreclaimed = 0; + LIST_FOREACH(sp, &nfsrv_stablefirst.nsf_head, nst_list) { + if ((sp->nst_flag & NFSNST_RECLAIMED) == 0) { + notreclaimed = 1; + break; + } + } + if (notreclaimed == 0) + nfsrv_stablefirst.nsf_flags |= (NFSNSF_GRACEOVER | + NFSNSF_NEEDLOCK); + } + if ((nfsrv_stablefirst.nsf_flags & NFSNSF_GRACEOVER) != 0) { if (flags & NFSLCK_RECLAIM) { error = NFSERR_NOGRACE; @@ -4745,6 +4765,32 @@ nfsrv_markstable(struct nfsclient *clp) } /* + * This function is called when a NFSv4.1 client does a ReclaimComplete. + * Very similar to nfsrv_markstable(), except for the flag being set. + */ +static void +nfsrv_markreclaim(struct nfsclient *clp) +{ + struct nfsrv_stable *sp; + + /* + * First find the client structure. + */ + LIST_FOREACH(sp, &nfsrv_stablefirst.nsf_head, nst_list) { + if (sp->nst_len == clp->lc_idlen && + !NFSBCMP(sp->nst_client, clp->lc_id, sp->nst_len)) + break; + } + if (sp == LIST_END(&nfsrv_stablefirst.nsf_head)) + return; + + /* + * Now, just set the flag. + */ + sp->nst_flag |= NFSNST_RECLAIMED; +} + +/* * This function is called for a reclaim, to see if it gets grace. * It returns 0 if a reclaim is allowed, 1 otherwise. */ @@ -5897,8 +5943,10 @@ nfsrv_checkreclaimcomplete(struct nfsrv_descript *nd) /* Check to see if reclaim complete has already happened. */ if ((sep->sess_clp->lc_flags & LCL_RECLAIMCOMPLETE) != 0) error = NFSERR_COMPLETEALREADY; - else + else { sep->sess_clp->lc_flags |= LCL_RECLAIMCOMPLETE; + nfsrv_markreclaim(sep->sess_clp); + } NFSUNLOCKSESSION(shp); NFSUNLOCKSTATE(); return (error); From owner-svn-src-stable-10@freebsd.org Tue Jul 17 21:10:32 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53AE1104EE09; Tue, 17 Jul 2018 21:10:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 035F27A1B8; Tue, 17 Jul 2018 21:10:32 +0000 (UTC) (envelope-from dim@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D47FC10D12; Tue, 17 Jul 2018 21:10:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6HLAVPX084256; Tue, 17 Jul 2018 21:10:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6HLAV3t084254; Tue, 17 Jul 2018 21:10:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201807172110.w6HLAV3t084254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 17 Jul 2018 21:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336429 - stable/10/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Commit-Revision: 336429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2018 21:10:32 -0000 Author: dim Date: Tue Jul 17 21:10:31 2018 New Revision: 336429 URL: https://svnweb.freebsd.org/changeset/base/336429 Log: Pull in r211155 from upstream llvm trunk (by Tim Northover): DAG: move sret demotion into most basic LowerCallTo implementation. It looks like there are two versions of LowerCallTo here: the SelectionDAGBuilder one is designed to operate on LLVM IR, and the TargetLowering one in the case where everything is at DAG level. Previously, only the SelectionDAGBuilder variant could handle demoting an impossible return to sret semantics (before delegating to the TargetLowering version), but this functionality is also useful for certain libcalls (e.g. 128-bit operations on 32-bit x86). So this commit moves the sret handling down a level. rdar://problem/17242889 This should fix "Call result #3 has unhandled type i32" errors when building devel/libslang2 for i386. Direct commit to stable/10, since clang 3.5 and later already have this change. Reported by: mi PR: 229754 Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Jul 17 21:08:01 2018 (r336428) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Jul 17 21:10:31 2018 (r336429) @@ -5348,6 +5348,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee, bool isTailCall, MachineBasicBlock *LandingPad) { + const TargetLowering *TLI = TM.getTargetLowering(); PointerType *PT = cast(CS.getCalledValue()->getType()); FunctionType *FTy = cast(PT->getElementType()); Type *RetTy = FTy->getReturnType(); @@ -5358,43 +5359,6 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSit TargetLowering::ArgListEntry Entry; Args.reserve(CS.arg_size()); - // Check whether the function can return without sret-demotion. - SmallVector Outs; - const TargetLowering *TLI = TM.getTargetLowering(); - GetReturnInfo(RetTy, CS.getAttributes(), Outs, *TLI); - - bool CanLowerReturn = TLI->CanLowerReturn(CS.getCallingConv(), - DAG.getMachineFunction(), - FTy->isVarArg(), Outs, - FTy->getContext()); - - SDValue DemoteStackSlot; - int DemoteStackIdx = -100; - - if (!CanLowerReturn) { - uint64_t TySize = TLI->getDataLayout()->getTypeAllocSize( - FTy->getReturnType()); - unsigned Align = TLI->getDataLayout()->getPrefTypeAlignment( - FTy->getReturnType()); - MachineFunction &MF = DAG.getMachineFunction(); - DemoteStackIdx = MF.getFrameInfo()->CreateStackObject(TySize, Align, false); - Type *StackSlotPtrType = PointerType::getUnqual(FTy->getReturnType()); - - DemoteStackSlot = DAG.getFrameIndex(DemoteStackIdx, TLI->getPointerTy()); - Entry.Node = DemoteStackSlot; - Entry.Ty = StackSlotPtrType; - Entry.isSExt = false; - Entry.isZExt = false; - Entry.isInReg = false; - Entry.isSRet = true; - Entry.isNest = false; - Entry.isByVal = false; - Entry.isReturned = false; - Entry.Alignment = Align; - Args.push_back(Entry); - RetTy = Type::getVoidTy(FTy->getContext()); - } - for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end(); i != e; ++i) { const Value *V = *i; @@ -5446,48 +5410,9 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSit "Non-null chain expected with non-tail call!"); assert((Result.second.getNode() || !Result.first.getNode()) && "Null value expected with tail call!"); - if (Result.first.getNode()) { + if (Result.first.getNode()) setValue(CS.getInstruction(), Result.first); - } else if (!CanLowerReturn && Result.second.getNode()) { - // The instruction result is the result of loading from the - // hidden sret parameter. - SmallVector PVTs; - Type *PtrRetTy = PointerType::getUnqual(FTy->getReturnType()); - ComputeValueVTs(*TLI, PtrRetTy, PVTs); - assert(PVTs.size() == 1 && "Pointers should fit in one register"); - EVT PtrVT = PVTs[0]; - - SmallVector RetTys; - SmallVector Offsets; - RetTy = FTy->getReturnType(); - ComputeValueVTs(*TLI, RetTy, RetTys, &Offsets); - - unsigned NumValues = RetTys.size(); - SmallVector Values(NumValues); - SmallVector Chains(NumValues); - - for (unsigned i = 0; i < NumValues; ++i) { - SDValue Add = DAG.getNode(ISD::ADD, getCurSDLoc(), PtrVT, - DemoteStackSlot, - DAG.getConstant(Offsets[i], PtrVT)); - SDValue L = DAG.getLoad(RetTys[i], getCurSDLoc(), Result.second, Add, - MachinePointerInfo::getFixedStack(DemoteStackIdx, Offsets[i]), - false, false, false, 1); - Values[i] = L; - Chains[i] = L.getValue(1); - } - - SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurSDLoc(), - MVT::Other, &Chains[0], NumValues); - PendingLoads.push_back(Chain); - - setValue(CS.getInstruction(), - DAG.getNode(ISD::MERGE_VALUES, getCurSDLoc(), - DAG.getVTList(&RetTys[0], RetTys.size()), - &Values[0], Values.size())); - } - if (!Result.second.getNode()) { // As a special case, a null chain means that a tail call has been emitted // and the DAG root is already updated. @@ -6989,6 +6914,21 @@ void SelectionDAGBuilder::visitPatchpoint(const CallIn DAG.DeleteNode(Call); } +/// Returns an AttributeSet representing the attributes applied to the return +/// value of the given call. +static AttributeSet getReturnAttrs(TargetLowering::CallLoweringInfo &CLI) { + SmallVector Attrs; + if (CLI.RetSExt) + Attrs.push_back(Attribute::SExt); + if (CLI.RetZExt) + Attrs.push_back(Attribute::ZExt); + if (CLI.IsInReg) + Attrs.push_back(Attribute::InReg); + + return AttributeSet::get(CLI.RetTy->getContext(), AttributeSet::ReturnIndex, + Attrs); +} + /// TargetLowering::LowerCallTo - This is the default LowerCallTo /// implementation, which just calls LowerCall. /// FIXME: When all targets are @@ -6997,24 +6937,62 @@ std::pair TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const { // Handle the incoming return values from the call. CLI.Ins.clear(); + Type *OrigRetTy = CLI.RetTy; SmallVector RetTys; - ComputeValueVTs(*this, CLI.RetTy, RetTys); - for (unsigned I = 0, E = RetTys.size(); I != E; ++I) { - EVT VT = RetTys[I]; - MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT); - unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), VT); - for (unsigned i = 0; i != NumRegs; ++i) { - ISD::InputArg MyFlags; - MyFlags.VT = RegisterVT; - MyFlags.ArgVT = VT; - MyFlags.Used = CLI.IsReturnValueUsed; - if (CLI.RetSExt) - MyFlags.Flags.setSExt(); - if (CLI.RetZExt) - MyFlags.Flags.setZExt(); - if (CLI.IsInReg) - MyFlags.Flags.setInReg(); - CLI.Ins.push_back(MyFlags); + SmallVector Offsets; + ComputeValueVTs(*this, CLI.RetTy, RetTys, &Offsets); + + SmallVector Outs; + GetReturnInfo(CLI.RetTy, getReturnAttrs(CLI), Outs, *this); + + bool CanLowerReturn = + this->CanLowerReturn(CLI.CallConv, CLI.DAG.getMachineFunction(), + CLI.IsVarArg, Outs, CLI.RetTy->getContext()); + + SDValue DemoteStackSlot; + int DemoteStackIdx = -100; + if (!CanLowerReturn) { + // FIXME: equivalent assert? + // assert(!CS.hasInAllocaArgument() && + // "sret demotion is incompatible with inalloca"); + uint64_t TySize = getDataLayout()->getTypeAllocSize(CLI.RetTy); + unsigned Align = getDataLayout()->getPrefTypeAlignment(CLI.RetTy); + MachineFunction &MF = CLI.DAG.getMachineFunction(); + DemoteStackIdx = MF.getFrameInfo()->CreateStackObject(TySize, Align, false); + Type *StackSlotPtrType = PointerType::getUnqual(CLI.RetTy); + + DemoteStackSlot = CLI.DAG.getFrameIndex(DemoteStackIdx, getPointerTy()); + ArgListEntry Entry; + Entry.Node = DemoteStackSlot; + Entry.Ty = StackSlotPtrType; + Entry.isSExt = false; + Entry.isZExt = false; + Entry.isInReg = false; + Entry.isSRet = true; + Entry.isNest = false; + Entry.isByVal = false; + Entry.isReturned = false; + Entry.Alignment = Align; + CLI.Args.insert(CLI.Args.begin(), Entry); + CLI.RetTy = Type::getVoidTy(CLI.RetTy->getContext()); + } else { + for (unsigned I = 0, E = RetTys.size(); I != E; ++I) { + EVT VT = RetTys[I]; + MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT); + unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), VT); + for (unsigned i = 0; i != NumRegs; ++i) { + ISD::InputArg MyFlags; + MyFlags.VT = RegisterVT; + MyFlags.ArgVT = VT; + MyFlags.Used = CLI.IsReturnValueUsed; + if (CLI.RetSExt) + MyFlags.Flags.setSExt(); + if (CLI.RetZExt) + MyFlags.Flags.setZExt(); + if (CLI.IsInReg) + MyFlags.Flags.setInReg(); + CLI.Ins.push_back(MyFlags); + } } } @@ -7137,31 +7115,60 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweri "LowerCall emitted a value with the wrong type!"); }); - // Collect the legal value parts into potentially illegal values - // that correspond to the original function's return values. - ISD::NodeType AssertOp = ISD::DELETED_NODE; - if (CLI.RetSExt) - AssertOp = ISD::AssertSext; - else if (CLI.RetZExt) - AssertOp = ISD::AssertZext; SmallVector ReturnValues; - unsigned CurReg = 0; - for (unsigned I = 0, E = RetTys.size(); I != E; ++I) { - EVT VT = RetTys[I]; - MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT); - unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), VT); + if (!CanLowerReturn) { + // The instruction result is the result of loading from the + // hidden sret parameter. + SmallVector PVTs; + Type *PtrRetTy = PointerType::getUnqual(OrigRetTy); - ReturnValues.push_back(getCopyFromParts(CLI.DAG, CLI.DL, &InVals[CurReg], - NumRegs, RegisterVT, VT, NULL, - AssertOp)); - CurReg += NumRegs; - } + ComputeValueVTs(*this, PtrRetTy, PVTs); + assert(PVTs.size() == 1 && "Pointers should fit in one register"); + EVT PtrVT = PVTs[0]; - // For a function returning void, there is no return value. We can't create - // such a node, so we just return a null return value in that case. In - // that case, nothing will actually look at the value. - if (ReturnValues.empty()) - return std::make_pair(SDValue(), CLI.Chain); + unsigned NumValues = RetTys.size(); + ReturnValues.resize(NumValues); + SmallVector Chains(NumValues); + + for (unsigned i = 0; i < NumValues; ++i) { + SDValue Add = CLI.DAG.getNode(ISD::ADD, CLI.DL, PtrVT, DemoteStackSlot, + CLI.DAG.getConstant(Offsets[i], PtrVT)); + SDValue L = CLI.DAG.getLoad( + RetTys[i], CLI.DL, CLI.Chain, Add, + MachinePointerInfo::getFixedStack(DemoteStackIdx, Offsets[i]), false, + false, false, 1); + ReturnValues[i] = L; + Chains[i] = L.getValue(1); + } + + CLI.Chain = CLI.DAG.getNode(ISD::TokenFactor, CLI.DL, MVT::Other, + &Chains[0], NumValues); + } else { + // Collect the legal value parts into potentially illegal values + // that correspond to the original function's return values. + ISD::NodeType AssertOp = ISD::DELETED_NODE; + if (CLI.RetSExt) + AssertOp = ISD::AssertSext; + else if (CLI.RetZExt) + AssertOp = ISD::AssertZext; + unsigned CurReg = 0; + for (unsigned I = 0, E = RetTys.size(); I != E; ++I) { + EVT VT = RetTys[I]; + MVT RegisterVT = getRegisterType(CLI.RetTy->getContext(), VT); + unsigned NumRegs = getNumRegisters(CLI.RetTy->getContext(), VT); + + ReturnValues.push_back(getCopyFromParts(CLI.DAG, CLI.DL, &InVals[CurReg], + NumRegs, RegisterVT, VT, NULL, + AssertOp)); + CurReg += NumRegs; + } + + // For a function returning void, there is no return value. We can't create + // such a node, so we just return a null return value in that case. In + // that case, nothing will actually look at the value. + if (ReturnValues.empty()) + return std::make_pair(SDValue(), CLI.Chain); + } SDValue Res = CLI.DAG.getNode(ISD::MERGE_VALUES, CLI.DL, CLI.DAG.getVTList(&RetTys[0], RetTys.size()), From owner-svn-src-stable-10@freebsd.org Wed Jul 18 09:32:44 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD53104107D; Wed, 18 Jul 2018 09:32:44 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB0BC7186F; Wed, 18 Jul 2018 09:32:43 +0000 (UTC) (envelope-from peterj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70425186E1; Wed, 18 Jul 2018 09:32:43 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6I9WhKk066206; Wed, 18 Jul 2018 09:32:43 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6I9WheM066205; Wed, 18 Jul 2018 09:32:43 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201807180932.w6I9WheM066205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Wed, 18 Jul 2018 09:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336448 - stable/10 X-SVN-Group: stable-10 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/10 X-SVN-Commit-Revision: 336448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 09:32:44 -0000 Author: peterj Date: Wed Jul 18 09:32:43 2018 New Revision: 336448 URL: https://svnweb.freebsd.org/changeset/base/336448 Log: Retrospectively document SVN branch point for stable-10 and its releases. This is a direct commit to stable/10 because the releases are taken from the stable/10 branch. Approved by: jhb (mentor) Differential Revision: D16263 Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Wed Jul 18 09:17:37 2018 (r336447) +++ stable/10/UPDATING Wed Jul 18 09:32:43 2018 (r336448) @@ -30,6 +30,9 @@ older version of current is a bit fragile. why, only to subsequently discover during installkernel that the desired kernel was never built in the first place. +20170915: + The releng/10.4 branch has been created from stable/10@r323601 + 20170824: Since the switch to GPT disk labels, fsck for UFS/FFS has been unable to automatically find alternate superblocks. As of r322860, @@ -65,6 +68,9 @@ older version of current is a bit fragile. by mkdir under .zfs/snapshot/. That should be the only user visible change. +20160304: + The releng/10.3 branch has been created from stable/10@r296371 + 20160124: The NONE and HPN patches has been removed from OpenSSH. They are still available in the security/openssh-portable port. @@ -124,6 +130,9 @@ older version of current is a bit fragile. Please consider using 'options KSTACK_PAGES=X' where X is greater than or equal to ZFS_MIN_KSTACK_PAGES i.e. 4 in such configurations. +20150723: + The releng/10.2 branch has been created from stable/10@r285827 + 20150703: The default Unbound configuration now enables remote control using a local socket. Users who have already enabled the @@ -191,6 +200,9 @@ older version of current is a bit fragile. 20141118: 10.1-RELEASE. +20141207: + The releng/10.1 branch has been created from stable/10@r272459. + 20140904: The ofwfb driver, used to provide a graphics console on PowerPC when using vt(4), no longer allows mmap() of all of physical memory. This @@ -305,6 +317,9 @@ older version of current is a bit fragile. big-endian integer in accordance with RFC 4402. __FreeBSD_version is bumped to 1000701. +20131207: + The releng/10.0 branch has been created from stable/10@r259064. + 20131108: The WITHOUT_ATF build knob has been removed and its functionality has been subsumed into the more generic WITHOUT_TESTS. If you were @@ -326,6 +341,10 @@ older version of current is a bit fragile. # make -C /usr/ports/ports-mgmt/pkg build deinstall install clean or # pkg install pkg; ldd /usr/local/sbin/pkg | grep bsdyml + +20131010: + The stable/10 branch has been created in subversion from head + revision r256279. 20131010: The rc.d/jail script has been updated to support jail(8) From owner-svn-src-stable-10@freebsd.org Wed Jul 18 14:41:29 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A61AE104CBD0; Wed, 18 Jul 2018 14:41:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0128B7D067; Wed, 18 Jul 2018 14:41:24 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w6IEfNV9007768; Wed, 18 Jul 2018 07:41:23 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w6IEfNMJ007767; Wed, 18 Jul 2018 07:41:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201807181441.w6IEfNMJ007767@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r336448 - stable/10 In-Reply-To: <201807180932.w6I9WheM066205@repo.freebsd.org> To: Peter Jeremy Date: Wed, 18 Jul 2018 07:41:23 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 14:41:29 -0000 > Author: peterj > Date: Wed Jul 18 09:32:43 2018 > New Revision: 336448 > URL: https://svnweb.freebsd.org/changeset/base/336448 > > Log: > Retrospectively document SVN branch point for stable-10 and its releases. > > This is a direct commit to stable/10 because the releases are taken > from the stable/10 branch. > > Approved by: jhb (mentor) > Differential Revision: D16263 Actually I see no reason not to document these in the mainline UPDATING file and making these MFC's. As is now when looking at UPDATING from head I can not easily find the branch point for any of these releases and that is probably the most useful time for this information. If I already have a branch I probably already know what its anchor point is. Regards, Rod > Modified: > stable/10/UPDATING > > Modified: stable/10/UPDATING > ============================================================================== > --- stable/10/UPDATING Wed Jul 18 09:17:37 2018 (r336447) > +++ stable/10/UPDATING Wed Jul 18 09:32:43 2018 (r336448) > @@ -30,6 +30,9 @@ older version of current is a bit fragile. > why, only to subsequently discover during installkernel that the > desired kernel was never built in the first place. > > +20170915: > + The releng/10.4 branch has been created from stable/10@r323601 > + > 20170824: > Since the switch to GPT disk labels, fsck for UFS/FFS has been > unable to automatically find alternate superblocks. As of r322860, > @@ -65,6 +68,9 @@ older version of current is a bit fragile. > by mkdir under .zfs/snapshot/. That should be the only user visible > change. > > +20160304: > + The releng/10.3 branch has been created from stable/10@r296371 > + > 20160124: > The NONE and HPN patches has been removed from OpenSSH. They are > still available in the security/openssh-portable port. > @@ -124,6 +130,9 @@ older version of current is a bit fragile. > Please consider using 'options KSTACK_PAGES=X' where X is greater > than or equal to ZFS_MIN_KSTACK_PAGES i.e. 4 in such configurations. > > +20150723: > + The releng/10.2 branch has been created from stable/10@r285827 > + > 20150703: > The default Unbound configuration now enables remote control > using a local socket. Users who have already enabled the > @@ -191,6 +200,9 @@ older version of current is a bit fragile. > 20141118: > 10.1-RELEASE. > > +20141207: > + The releng/10.1 branch has been created from stable/10@r272459. > + > 20140904: > The ofwfb driver, used to provide a graphics console on PowerPC when > using vt(4), no longer allows mmap() of all of physical memory. This > @@ -305,6 +317,9 @@ older version of current is a bit fragile. > big-endian integer in accordance with RFC 4402. > __FreeBSD_version is bumped to 1000701. > > +20131207: > + The releng/10.0 branch has been created from stable/10@r259064. > + > 20131108: > The WITHOUT_ATF build knob has been removed and its functionality > has been subsumed into the more generic WITHOUT_TESTS. If you were > @@ -326,6 +341,10 @@ older version of current is a bit fragile. > # make -C /usr/ports/ports-mgmt/pkg build deinstall install clean > or > # pkg install pkg; ldd /usr/local/sbin/pkg | grep bsdyml > + > +20131010: > + The stable/10 branch has been created in subversion from head > + revision r256279. > > 20131010: > The rc.d/jail script has been updated to support jail(8) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-10@freebsd.org Wed Jul 18 19:05:23 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0698102E5C1; Wed, 18 Jul 2018 19:05:22 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 175EB8885C; Wed, 18 Jul 2018 19:05:21 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id w6IJ5BY9050933 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jul 2018 05:05:18 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id w6IJ56RE046038 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jul 2018 05:05:06 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id w6IJ56D8046037; Thu, 19 Jul 2018 05:05:06 +1000 (AEST) (envelope-from peter) Date: Thu, 19 Jul 2018 05:05:06 +1000 From: Peter Jeremy To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r336448 - stable/10 Message-ID: <20180718190506.GA45754@server.rulingia.com> References: <201807180932.w6I9WheM066205@repo.freebsd.org> <201807181441.w6IEfNMJ007767@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <201807181441.w6IEfNMJ007767@pdx.rh.CN85.dnsmgr.net> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 19:05:23 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2018-Jul-18 07:41:23 -0700, "Rodney W. Grimes" wrote: >> Author: peterj >> Date: Wed Jul 18 09:32:43 2018 >> New Revision: 336448 >> URL: https://svnweb.freebsd.org/changeset/base/336448 >>=20 >> Log: >> Retrospectively document SVN branch point for stable-10 and its releas= es. >> =20 >> This is a direct commit to stable/10 because the releases are taken >> from the stable/10 branch. >> =20 >> Approved by: jhb (mentor) >> Differential Revision: D16263 > >Actually I see no reason not to document these in the mainline >UPDATING file and making these MFC's. As is now when looking >at UPDATING from head I can not easily find the branch point >for any of these releases and that is probably the most useful >time for this information. If I already have a branch I probably >already know what its anchor point is. I only put the releng/x.y branch points into the relevant stable/x/UPDATING because releng/x.y is branched off stable/x and I don't think it makes much sense to document those in head/UPDATING. The stable/x branchpoints are in both head/UPDATING and stable/x/UPDATING. Note that the stable/10 branch- point was already in head/UPDATING. Do you have a quick way to find branch points? The best I've found is "svn log -r 1:HEAD --limit 1 --stop-on-copy" within a branch and that is quite resource intensive on the SVN server. --=20 Peter Jeremy --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAltPj2JfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzR/RA/8DdT/k8oIyuQYOx9iQlk/I4D7OMKX5tpmfM91BMA3AnlStu2OuItWtP1T ahIOa0hD14bFXlkoKBiuM8SfKQomjBPpofdyX60XA0Zdp/HqfqUJqMiQsYpf5OX8 iGiFTdd3Ey8QcOsb/bKREhFQ7KBo05vc22yld7UOocbGMEVjijBgFe0sTjFC766V CJ0mZOynf3rNKRPUjGIL1OxNp1UNxAvSoToWMX99r4scG4aynGRMD7kis0yk8IRH Lbdvbgtuxp1qARTUOlCEp42MvOzNPm1i9C5ml+GXd6iQd4YGV5YI+4f+uWIfdhFV KayFeG89K8xo6aSy+7tksJqmvAyBo7RTPwEk0o+8g+DrgMz8uJA6NaNm/ZYZDOOm YPC3hEMKl9zIu/4QvrVDM7KncpB5BDXuWxzsj86bnxnx8OVVXa5SrkkqbTlgOXx9 gU9HuaJomXBaavb/ciyD/Wn/slHmFwWqnhm9FpyPwL0BcfW7bj3wI0zlCq/WFEEH /6IA6g5MnuiWLACgJyDmsfPHT2/bLE6Zn1saBqzmUyX4wgnmEonoeRR/67X6c4vh iVXnv4KMUtAMeWQOncRdKSnMjyzs+paqaT90rs2xxjNMato68AzY+p6Ecg072EwB 5a20hjueHJmSY9zLYZVd7ZCuvI5O+nADcIAJJE3fNWOIN5LpWXc= =+Iv4 -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD-- From owner-svn-src-stable-10@freebsd.org Thu Jul 19 21:07:40 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6CB8104B349; Thu, 19 Jul 2018 21:07:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98D507C8E3; Thu, 19 Jul 2018 21:07:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79FD92E86B; Thu, 19 Jul 2018 21:07:39 +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 w6JL7dFh067947; Thu, 19 Jul 2018 21:07:39 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6JL7dmb067946; Thu, 19 Jul 2018 21:07:39 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807192107.w6JL7dmb067946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 19 Jul 2018 21:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r336518 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsserver X-SVN-Commit-Revision: 336518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2018 21:07:40 -0000 Author: rmacklem Date: Thu Jul 19 21:07:39 2018 New Revision: 336518 URL: https://svnweb.freebsd.org/changeset/base/336518 Log: MFC: r333766 Add a missing nfsrv_freesession() call for an unlikely failure case. Since NFSv4.1 clients normally create a single session which supports both fore and back channels, it is unlikely that a callback will fail due to a lack of a back channel. However, if this failure occurred, the session wasn't being dereferenced and would never be free'd. Found by inspection during pNFS server development. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Thu Jul 19 21:06:58 2018 (r336517) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Thu Jul 19 21:07:39 2018 (r336518) @@ -4251,9 +4251,10 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, */ (void) newnfs_sndlock(&clp->lc_req.nr_lock); if (clp->lc_req.nr_client == NULL) { - if ((clp->lc_flags & LCL_NFSV41) != 0) + if ((clp->lc_flags & LCL_NFSV41) != 0) { error = ECONNREFUSED; - else if (nd->nd_procnum == NFSV4PROC_CBNULL) + nfsrv_freesession(sep, NULL); + } else if (nd->nd_procnum == NFSV4PROC_CBNULL) error = newnfs_connect(NULL, &clp->lc_req, cred, NULL, 1); else