From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:38130 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbeGKNNQ (ORCPT ); Wed, 11 Jul 2018 09:13:16 -0400 Date: Wed, 11 Jul 2018 06:08:54 -0700 From: Matthew Wilcox To: Dominique Martinet 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: <20180711130854.GB23640@bombadil.infradead.org> References: <20180628132629.3148-1-willy@infradead.org> <20180628132629.3148-3-willy@infradead.org> <20180711124038.GB835@nautica> <20180711125219.GA23640@bombadil.infradead.org> <20180711125812.GA9691@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711125812.GA9691@nautica> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jul 11, 2018 at 02:58:12PM +0200, Dominique Martinet wrote: > > 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) Heh, unintended protocol fuzzing ;-) I see the problem; need to initialise fid->fid to 0 before calling idr_alloc_u32. I'd misread: memset(&fid->qid, 0, sizeof(struct p9_qid)); as memset(fid, 0, sizeof(struct p9_fid)); so I thought fid->fid was already 0. I'll fix that up, thanks!