From: Toshiyuki Okajima Subject: Re: [RFC][PATCH] radix_tree: radix_tree_gang_lookup_tag_slot may not return forever. Date: Tue, 25 Jan 2011 13:53:45 +0900 Message-ID: <20110125135345.ca4bfd79.toshi.okajima@jp.fujitsu.com> References: <20110121153431.acd113d8.toshi.okajima@jp.fujitsu.com> <20110121153154.1ca74dd2.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__25_Jan_2011_13_53_45_+0900_hdvDNBiX8uT2kqgN" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Jan Kara To: Andrew Morton Return-path: In-Reply-To: <20110121153154.1ca74dd2.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org This is a multi-part message in MIME format. --Multipart=_Tue__25_Jan_2011_13_53_45_+0900_hdvDNBiX8uT2kqgN Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Andrew, On Fri, 21 Jan 2011 15:31:54 -0800 Andrew Morton wrote: > On Fri, 21 Jan 2011 15:34:31 +0900 > Toshiyuki Okajima wrote: > > > Hi. > > > > I executed fsstress and then found that the system hung up. > > At that time, I took the crash dump. Here is the backtrace of the process > > which causes this hangup. > > > > [long description] > > > > --- a/lib/radix-tree.c > > +++ b/lib/radix-tree.c > > @@ -736,10 +736,11 @@ next: > > } > > } > > /* > > - * The iftag must have been set somewhere because otherwise > > - * we would return immediated at the beginning of the function > > + * We need not to tag the root tag if there is no tag which is set with > > + * settag within the range from *first_indexp to last_index. > > */ > > - root_tag_set(root, settag); > > + if (tagged > 0) > > + root_tag_set(root, settag); > > *first_indexp = index; > > > > return tagged; > > Thanks. > > It should be fairly simple to reproduce this hang with the userspace > test harness (http://userweb.kernel.org/~akpm/stuff/rtth.tar.gz) and to > then demonstrate that the fix fixes it. > > If you have time, could you please do that and then send the rtth > updates to me? > I add regression2_test for this bug into your testset (rtth.tar.gz). This is originated from regression1_test. Regards, Toshiyuki Okajima --Multipart=_Tue__25_Jan_2011_13_53_45_+0900_hdvDNBiX8uT2kqgN Content-Type: application/octet-stream; name="rtth.patch" Content-Disposition: attachment; filename="rtth.patch" Content-Transfer-Encoding: base64 ZGlmZiAtTnVycCBydHRoLm9yZy9NYWtlZmlsZSBydHRoL01ha2VmaWxlCi0tLSBydHRoLm9yZy9N YWtlZmlsZQkyMDEwLTExLTExIDA5OjAyOjQ5LjAwMDAwMDAwMCArMDkwMAorKysgcnR0aC9NYWtl ZmlsZQkyMDExLTAxLTI0IDE3OjM4OjA4LjAwMDAwMDAwMCArMDkwMApAQCAtMiw3ICsyLDcgQEAK IENGTEFHUyArPSAtSS4gLWcgLVdhbGwgLURfTEdQTF9TT1VSQ0UKIExERkxBR1MgKz0gLWxwdGhy ZWFkIC1sdXJjdQogVEFSR0VUUyA9IG1haW4KLU9GSUxFUyA9IG1haW4ubyByY3VwZGF0ZS5vIHJh ZGl4LXRyZWUubyBsaW51eC5vIHRlc3QubyB0YWdfY2hlY2subyByZWdyZXNzaW9uMS5vCitPRklM RVMgPSBtYWluLm8gcmN1cGRhdGUubyByYWRpeC10cmVlLm8gbGludXgubyB0ZXN0Lm8gdGFnX2No ZWNrLm8gcmVncmVzc2lvbjEubyByZWdyZXNzaW9uMi5vCiAKIHRhcmdldHM6ICQoVEFSR0VUUykK IApkaWZmIC1OdXJwIHJ0dGgub3JnL21haW4uYyBydHRoL21haW4uYwotLS0gcnR0aC5vcmcvbWFp bi5jCTIwMTAtMTEtMTEgMDk6MDI6NDkuMDAwMDAwMDAwICswOTAwCisrKyBydHRoL21haW4uYwky MDExLTAxLTI1IDEzOjQ4OjU1LjAwMDAwMDAwMCArMDkwMApAQCAtMjYwLDYgKzI2MCw3IEBAIGlu dCBtYWluKCkKIAlyYWRpeF90cmVlX2luaXQoKTsKIAogCXJlZ3Jlc3Npb24xX3Rlc3QoKTsKKwly ZWdyZXNzaW9uMl90ZXN0KCk7CiAKIA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