Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp638404imm; Wed, 11 Jul 2018 08:28:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcXD53SemxgRXXFzM5QnNchTbLUnTuXOuFUcDVbT0/xiU5VHWzSgDt6hrv/64yC74cLACz5 X-Received: by 2002:a65:5641:: with SMTP id m1-v6mr27733108pgs.246.1531322938809; Wed, 11 Jul 2018 08:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531322938; cv=none; d=google.com; s=arc-20160816; b=w8yDl9eJAOeu+VkLV8pHy6ZL0KedRuIi/C+/Vrzr3oo4ahFOZdCTL05VZqqqv5ZNBN PnfEOIqMPZs4qkZolC/gwdGb+Ef/iHeFMcQ8szcBJW4VdJAWfUO/ifhQm8jeoRZu1uK8 a08q28q1+LrTBF7mkBxbsHmhSHlaxRa9FQ1RlGVU66Pk8PkH31SC+p1XHddEx3SpDjUR I7tF8MD17q8UJVP4bNqgMLRczckO6XEeDOmk2MwQlYuO4NRYvZKIMwj9qV64kEYmVF3D mYDQrUipG8DDQ36QouqwHRTxHZ/PWc8W/CoVjZ57gAnkeoumimWVOXqyhFF69jtmCkDJ dQYQ== 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=GWiWIEcc5ALfDadc3M290iBVonoA24Zv+0yqoGA90ko=; b=jnOHpfIoHRlB96nNAZh1G8xeUEG1nfN9Keo6CDew66sQPHECBcgKjRNJ8gt4sgE1lz R8OV+J09mtJsSKeQa/h/wuX8sVscKpdn5QaK2NGzsI/1wnFD9W1yBFeKsf2TI5XCsBu0 mPUgcAaUu87VqOhL8qxJq29pWrlnNmWNc1VQt+wzM4h620YVg64QZuNB7cUoN8px6lfT D98Lz656GVrSF+whAT+NNpcSbdSpcR/gLWYCzQlnGzZl91+CJkeaaoUD2DzyNtcSKQ7b AZbp0lDlpsIImFmTIT9K9rP3oSmFdjLO2jUWb743mFjX/EkP+Tub1Sk9Z0i486AHIONj YXgA== 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 m18-v6si18096919pgg.693.2018.07.11.08.28.43; Wed, 11 Jul 2018 08:28:58 -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 S2387482AbeGKNCn (ORCPT + 99 others); Wed, 11 Jul 2018 09:02:43 -0400 Received: from nautica.notk.org ([91.121.71.147]:44202 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbeGKNCm (ORCPT ); Wed, 11 Jul 2018 09:02:42 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id D9864C009; Wed, 11 Jul 2018 14:58:27 +0200 (CEST) Date: Wed, 11 Jul 2018 14:58:12 +0200 From: Dominique Martinet To: Matthew Wilcox Cc: v9fs-developer@lists.sourceforge.net, Latchesar Ionkov , Eric Van Hensbergen , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ron Minnich Subject: Re: [V9fs-developer] [PATCH 2/6] 9p: Replace the fidlist with an IDR Message-ID: <20180711125812.GA9691@nautica> References: <20180628132629.3148-1-willy@infradead.org> <20180628132629.3148-3-willy@infradead.org> <20180711124038.GB835@nautica> <20180711125219.GA23640@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180711125219.GA23640@bombadil.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: > On Wed, Jul 11, 2018 at 02:40:38PM +0200, Dominique Martinet wrote: > > > + idr_preload(GFP_KERNEL); > > > + spin_lock_irq(&clnt->lock); > > > + ret = idr_alloc_u32(&clnt->fids, fid, &fid->fid, UINT_MAX, GFP_NOWAIT); > > > > There's also a P9_NOFID that we shouldn't use, so the max here should be > > P9_NOFID - 1 > > Happy to fix that. It shouldn't actually happen, of course. I can't > imagine us having 4 billion FIDs in use at once. Oh, I said that assuming that it was random.. But I guess we might as well fix it. > > That aside this introduces a change of behaviour that fid used to be > > alloc'd linearily from 0 which no longer holds true, that breaks one > > serveur (nfs-ganesha just returns ERANGE) but others seem to handle this > > just fine so they'll just need to fix that server. > > max aside this looks good. > > I don't understand your assertion that this is a change of behaviour. > The implementation of p9_idpool_get() uses idr_alloc(), not > idr_alloc_cyclic(), so I don't believe I've changed which FID would > be allocated. Hmm, I just tried mounting something with ganesha and that broke because it received fid=1730858632 in a TATTACH request, so something in the patch series made some big fid happens. If you say this isn't intented though this needs debugging, I'm glad I brought this up :P (Note that it really should be fine if it is random within the pool, I have notified the current developpers of the problem) -- Dominique