[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87hb5y4gl2.fsf@tucsk.pomaz.szeredi.hu>
Date: Wed, 03 Aug 2011 18:15:05 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Christoph Hellwig <hch@...radead.org>
Cc: viro@...IV.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, jack@...e.cz,
akpm@...ux-foundation.org, toshi.okajima@...fujitsu.com
Subject: Re: [PATCH 1/4] vfs: ignore error on forced remount
Christoph Hellwig <hch@...radead.org> writes:
> On Wed, Aug 03, 2011 at 12:48:38PM +0200, Miklos Szeredi wrote:
>> From: Miklos Szeredi <mszeredi@...e.cz>
>>
>> On emergency remount we want to force MS_RDONLY on the super block
>> even if ->remount_fs() failed for some reason.
>
> Eww, dangerous territory. At the very least we should log something
> in the kernel log for thise case.
Like this?
Thanks,
Miklos
----
Subject: vfs: ignore error on forced remount
From: Miklos Szeredi <mszeredi@...e.cz>
On emergency remount we want to force MS_RDONLY on the super block
even if ->remount_fs() failed for some reason.
Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
---
fs/super.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6/fs/super.c
===================================================================
--- linux-2.6.orig/fs/super.c 2011-08-03 16:54:26.000000000 +0200
+++ linux-2.6/fs/super.c 2011-08-03 17:11:56.000000000 +0200
@@ -727,8 +727,13 @@ int do_remount_sb(struct super_block *sb
if (sb->s_op->remount_fs) {
retval = sb->s_op->remount_fs(sb, &flags, data);
- if (retval)
- return retval;
+ if (retval) {
+ if(!force)
+ return retval;
+ /* If forced remount, go ahead despite any errors */
+ WARN(1, "forced remount of a %s fs returned %i\n",
+ sb->s_type->name, retval);
+ }
}
sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists