From: Johan Herland Date: Wed, 05 Feb 2020 17:16:40 GMT Subject: Re: [PATCH 2/2] notes.c: fix off-by-one error when decreasing notes fanout Message-ID: In-Reply-To: <20200204010523.GR4113372@camp.crustytoothpaste.net> On Tue, Feb 4, 2020 at 2:05 AM brian m. carlson wrote: > On 2020-02-03 at 21:04:45, Johan Herland wrote: > > always follow the ->next pointer from the last non-note we wrote. > > (This part is was caught by an existing test in t3304.) > > I think you have "is was" here. You probably want one or the other. Will fix. > > Cc: Johannes Schindelin > > Cc: Brian M. Carlson > > I generally write my name in lower case, but I think typically we prefer > to omit Cc lines in patches (unlike LKML), so it may just be better to > remove these lines. Ack. Will remove. > > Signed-off-by: Johan Herland > > Patch 1 looked good to me. Your explanation here makes sense, but I > must admit that I still don't understand this code, so I can't give an > outright approval. I do appreciate that it comes with a test, though. Thanks for having a look. I must admit it's hard to get back into this code even though I originally wrote it. I've been trying to prepare a patch #3 which decreases the fanout more aggressively on notes removal (having a fanout of 1 in a tree of 17 notes is bit ridiculous, IMHO), but I'm not yet able to figure something out that behaves in a stable manner. (I find scenarios where removing a note will switch fanout from 1 to 0, but removing another note will then switch fanout from 0 back to 1, and so on, and the current notes code does not have these problems, AFAICS.) > I haven't tested, but I expect this series will make Dscho's patch > unnecessary, so I'll drop it in my reroll unless one of you tells me to > keep it. Yes, my patch includes Dscho's change. I don't particularly care whichever lands first, and I can easily rebase on top of yours. ...Johan -- Johan Herland, www.herland.net