Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1568206imm; Thu, 12 Jul 2018 04:18:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpekpmD/uYv9cH3Y8UHlu6v7eEk2q5CckxBB01RlZ7T9K+O5lSJTpbvvClWGxHeWNh8NUAce X-Received: by 2002:a63:91c8:: with SMTP id l191-v6mr1693234pge.180.1531394314846; Thu, 12 Jul 2018 04:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531394314; cv=none; d=google.com; s=arc-20160816; b=wRPha5DvtLocnAX5myR7GCdu2sY/AZpkiWZMOZVh4pGCAbKTZFXWLGKZTeR5W+pOTJ JMFineOFA2k3HW844bJaIOsgr4nuPQFcoY+JyxB52651pFG9N37YI/K8/uWZGofWpwg/ dykNd/Gh0onrUv2ncZG3Rsc6UNx6hUY68K8S/Jqh8A1wruV+h3Pauc8FHOpsZD5ilrdN 63dNzwoATFkF5c8zg6+WRVS9rKLU0iE96BAHosiQPetDgn/WTj0zR1nF++5/GG3cH0XZ f7qXMkjr5nVs/8ncsTYflmxYZMGmIfBvFspWADsf117djKPOTnzwQgMHlLkMErdxoTfN whyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7wDaxHoIMR25IbfSkWFhmUyij1yFiGZEMSESneHqIGk=; b=f0VEVI8raqDunBzqpvod9j3iY0pmI3x7q5hRUrg4h35B4lbwix6cb1QtTo3I40hZcP PvC/AmYYmmfjvVeeixdn7/lvQrffhDcRxtMGHSC1L3jE5n03HWfDG7QNPQUHCuto2CWm 2NQX4+VMybAGa0KvCF77l0nV1J9gna59Dnekh7rCdHzjZTzgFsIZQrVp1VcIy9nFQCZD xlFOf6FdhANZ7W13qCizJ6XGv/VT39+GlmoY9BOrnOvW9fd1twNeQF31r6HvlCt991Yn sWgfLn8U312P5Yz50T+JlrAioP4DIc6BhDSKgnavWZBJdNKOpVmKFcfglqb5MHU3w+gh FIHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg8-v6si4251601plb.243.2018.07.12.04.18.18; Thu, 12 Jul 2018 04:18:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbeGLL0t (ORCPT + 99 others); Thu, 12 Jul 2018 07:26:49 -0400 Received: from nautica.notk.org ([91.121.71.147]:48120 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbeGLL0s (ORCPT ); Thu, 12 Jul 2018 07:26:48 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id C8E8FC009; Thu, 12 Jul 2018 13:17:41 +0200 (CEST) Date: Thu, 12 Jul 2018 13:17:26 +0200 From: Dominique Martinet To: Matthew Wilcox Cc: v9fs-developer@lists.sourceforge.net, Latchesar Ionkov , Eric Van Hensbergen , Ron Minnich , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 3/6] 9p: Replace the fidlist with an IDR Message-ID: <20180712111726.GA17774@nautica> References: <20180711210225.19730-1-willy@infradead.org> <20180711210225.19730-4-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180711210225.19730-4-willy@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthew Wilcox wrote on Wed, Jul 11, 2018: > diff --git a/net/9p/client.c b/net/9p/client.c > index 389a2904b7b3..b89c7298267c 100644 > --- a/net/9p/client.c > +++ b/net/9p/client.c > @@ -908,30 +908,29 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt) > { > int ret; > struct p9_fid *fid; > - unsigned long flags; > > p9_debug(P9_DEBUG_FID, "clnt %p\n", clnt); > fid = kmalloc(sizeof(struct p9_fid), GFP_KERNEL); > if (!fid) > return NULL; > > - ret = p9_idpool_get(clnt->fidpool); > - if (ret < 0) > - goto error; > - fid->fid = ret; > - > memset(&fid->qid, 0, sizeof(struct p9_qid)); Ah, I had missed that you didn't update this memset as you said in reply to comment on v1. Could you resend just this patch and either initialize fid->fid or use kzalloc for the fid allocation? > fid->mode = -1; > fid->uid = current_fsuid(); > fid->clnt = clnt; > fid->rdir = NULL; > - spin_lock_irqsave(&clnt->lock, flags); > - list_add(&fid->flist, &clnt->fidlist); > - spin_unlock_irqrestore(&clnt->lock, flags); > + fid->fid = 0; > > - return fid; > + idr_preload(GFP_KERNEL); > + spin_lock_irq(&clnt->lock); > + ret = idr_alloc_u32(&clnt->fids, fid, &fid->fid, P9_NOFID - 1, > + GFP_NOWAIT); If you do resend, alignment here was wrong. Thanks, -- Dominique Martinet