From: Jan Kara Subject: Remount read-only races? Date: Tue, 2 Aug 2011 14:09:31 +0200 Message-ID: <20110802120931.GC18545@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Toshiyuki Okajima To: Al Viro , mszeredi@suse.cz Return-path: Received: from cantor2.suse.de ([195.135.220.15]:44221 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071Ab1HBMJd (ORCPT ); Tue, 2 Aug 2011 08:09:33 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, Toshiyuki reported an ext3 error message which implies that we can have unlinked but open files on read-only filesystem. Apparently open+unlink races with remount in some way. Looking at code in do_remount_sb() I don't see what prevents open("file", O_WRONLY) to happen after the check fs_may_remount_ro() and before the filesystem is marked as read-only. So are we expected to prevent these races? If yes, do I just miss something or the above race is really there? Thanks for reply in advance. Honza -- Jan Kara SUSE Labs, CR