From mboxrd@z Thu Jan 1 00:00:00 1970 From: sdrb Subject: Semaphore should be released in get_super Date: Tue, 24 May 2011 12:06:15 +0200 Message-ID: <4DDB8317.7040300@onet.eu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040606050909010808050603" To: linux-fsdevel@vger.kernel.org Return-path: Received: from smtpo11.poczta.onet.pl ([213.180.142.142]:41487 "EHLO smtpo11.poczta.onet.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754523Ab1EXKS3 (ORCPT ); Tue, 24 May 2011 06:18:29 -0400 Received: from localhost.localdomain (unknown [83.238.22.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sdrb@onet.eu) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 87BE32007EE26 for ; Tue, 24 May 2011 12:06:36 +0200 (CEST) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------040606050909010808050603 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, Probably I found a bug in get_super() proc. I think there should be semaphore released before return sb. I attached diff file. regards, sdrb --------------040606050909010808050603 Content-Type: text/x-patch; name="super.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="super.diff" diff --git a/fs/super.c b/fs/super.c index c04f7e0..361bbec 100644 --- a/fs/super.c +++ b/fs/super.c @@ -473,8 +473,10 @@ rescan: spin_unlock(&sb_lock); down_read(&sb->s_umount); /* still alive? */ - if (sb->s_root) + if (sb->s_root) { + up_read(&sb->s_umount); return sb; + } up_read(&sb->s_umount); /* nope, got unmounted */ spin_lock(&sb_lock); --------------040606050909010808050603--