From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759437Ab0JZORf (ORCPT ); Tue, 26 Oct 2010 10:17:35 -0400 Received: from fxip-0047f.externet.hu ([88.209.222.127]:35251 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758944Ab0JZORd (ORCPT ); Tue, 26 Oct 2010 10:17:33 -0400 Message-Id: <20101026141701.651043354@szeredi.hu> References: <20101026141641.315420064@szeredi.hu> User-Agent: quilt/0.46-1 Date: Tue, 26 Oct 2010 16:16:45 +0200 From: Miklos Szeredi To: viro@zeniv.linux.org.uk Cc: dave@linux.vnet.ibm.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] vfs: fs_may_remount_ro: turn unnecessary check into a WARN_ON Content-Disposition: inline; filename=vfs-remove-unnecessary-remount-check.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miklos Szeredi Now a successful sb_prepare_remount_readonly() should ensure that no writable files remain for this superblock. So turn this check into a WARN_ON. Signed-off-by: Miklos Szeredi --- fs/file_table.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Index: linux-2.6/fs/file_table.c =================================================================== --- linux-2.6.orig/fs/file_table.c 2010-10-26 14:26:57.000000000 +0200 +++ linux-2.6/fs/file_table.c 2010-10-26 14:27:05.000000000 +0200 @@ -437,8 +437,11 @@ int fs_may_remount_ro(struct super_block if (inode->i_nlink == 0) goto too_bad; - /* Writeable file? */ - if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE)) + /* + * Writable file? + * Should be caught by sb_prepare_remount_readonly(). + */ + if (WARN_ON(S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE))) goto too_bad; } while_file_list_for_each_entry; lg_global_unlock(files_lglock); --