From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from b.ns.miles-group.at ([95.130.255.144] helo=radon.swed.at) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WLL0L-00049q-9L for linux-mtd@lists.infradead.org; Wed, 05 Mar 2014 23:13:38 +0000 Message-ID: <5317AF63.8000807@nod.at> Date: Thu, 06 Mar 2014 00:12:35 +0100 From: Richard Weinberger MIME-Version: 1.0 To: Bill Pringlemeir Subject: Re: UBI leb_write_unlock NULL pointer Oops (continuation) References: <52EF9FFE.4020405@nod.at> <52F1F658.9080701@nod.at> <87zjlxy8lj.fsf@nbsps.com> <87txc4w698.fsf@nbsps.com> <877g8ojqsn.fsf@nbsps.com> <53079725.6080105@nod.at> <87ios8gsho.fsf@nbsps.com> <87k3coq8di.fsf@nbsps.com> <530860B1.9000808@nod.at> <877g8kr1h7.fsf@nbsps.com> <530B670B.3090002@nod.at> <87sir8ms41.fsf@nbsps.com> <87ob1wmrzi.fsf@nbsps.com> <53178FC6.6060605@nod.at> <87txbcib93.fsf@nbsps.com> <87ppm0iaq3.fsf@nbsps.com> In-Reply-To: <87ppm0iaq3.fsf@nbsps.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Wiedemer, Thorsten \(Lawo AG\)" , Artem Bityutskiy , "linux-mtd@lists.infradead.org" , "Ziegler, Emanuel \(Lawo AG\)" List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Am 05.03.2014 22:42, schrieb Bill Pringlemeir: > On 5 Mar 2014, bpringlemeir@nbsps.com wrote: > >> On 5 Mar 2014, richard@nod.at wrote: > >>> The solution is rather trivial. > > [snip] > >> Still, the logic of ubi_eba_copy_leb() seems really weird to me. I >> don't understand, > >> It looks like a double reference count decrement. Maybe they operate on >> different ltree nodes, but then the locks mis-match. > > if (down_write_trylock(&le->mutex)) > return 0; > > Ah, I mis-understood. The path where the lock is taken doesn't > decrement the 'users' count; I was thinking of '0' as fail. Welcome to UNIX where 0 is success. :-) Thanks, //richard