From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751306AbbA3FLF (ORCPT ); Fri, 30 Jan 2015 00:11:05 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:28088 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbbA3FLD (ORCPT ); Fri, 30 Jan 2015 00:11:03 -0500 X-AuditID: cbfee61b-f79d76d0000024d6-7d-54cb1265b983 From: Chao Yu To: "'Jaegeuk Kim'" Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <1422401503-4769-1-git-send-email-jaegeuk@kernel.org> <1422401503-4769-2-git-send-email-jaegeuk@kernel.org> <002b01d03bba$37f763a0$a7e62ae0$@samsung.com> <20150129182745.GB15313@jaegeuk-mac02.mot.com> In-reply-to: <20150129182745.GB15313@jaegeuk-mac02.mot.com> Subject: RE: [PATCH 2/5] f2fs: support norecovery mount option Date: Fri, 30 Jan 2015 13:10:15 +0800 Message-id: <006401d03c4b$2380c600$6a825200$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQKDs63B3JtDSVeEmIqjDxgyUQN23AF9mXXTASb7dT8BqVw6S5tOvTDg Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t9jQd1UodMhBj1bFS2erJ/FbHFpkbvF nr0nWSwu75rD5sDisWlVJ5vH7gWfmTw+b5ILYI7isklJzcksSy3St0vgyjhyta7gn0zF1VvT 2RsY74h1MXJySAiYSNz5d4kRwhaTuHBvPVsXIxeHkMB0RolD+xcxQTg/GCUOntnCBFLFJqAi sbzjP5gtIqAm0btvCpjNLJApMaH/BTtEwy1Gic+nDoIlOAWsJab/m8vaxcjBISxgJ3HrhT2I ySKgKrHrsQFIBa+ApcS2M39YIWxBiR+T77FAjNSSWL/zONR4eYnNa94yQxyqILHj7GtGiBPc JJZtvgZVIy6x8cgtlgmMQrOQjJqFZNQsJKNmIWlZwMiyilE0tSC5oDgpPddIrzgxt7g0L10v OT93EyM47J9J72Bc1WBxiFGAg1GJh9fj8akQIdbEsuLK3EOMEhzMSiK8+seAQrwpiZVVqUX5 8UWlOanFhxilOViUxHmV7NtChATSE0tSs1NTC1KLYLJMHJxSDYyCdh9qOVc92d5YxBss3T5T a1rMLX+bDOMcteRZXwNuGv6wXLb01cRJ66Ute7ObDD69CxIPMbAt/yz/pTq/LyO6e4q+sNuD mj7ZQz9LvPJvXjhSHOHnJRe67+uG+L5cBe0kcTku8YzFobnCri2bHpcdrDw28b3ao9N7rwel nu94yKJ3qLt4txJLcUaioRZzUXEiANLofNZ3AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Friday, January 30, 2015 2:28 AM > To: Chao Yu > Cc: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org; > linux-f2fs-devel@lists.sourceforge.net > Subject: Re: [PATCH 2/5] f2fs: support norecovery mount option > > Hi Chao, > > On Thu, Jan 29, 2015 at 07:52:56PM +0800, Chao Yu wrote: > > Hi Jaegeuk, > > > > > -----Original Message----- > > > From: linux-fsdevel-owner@vger.kernel.org [mailto:linux-fsdevel-owner@vger.kernel.org] On > > > Behalf Of Jaegeuk Kim > > > Sent: Wednesday, January 28, 2015 7:32 AM > > > To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org; > > > linux-f2fs-devel@lists.sourceforge.net > > > Cc: Jaegeuk Kim > > > Subject: [PATCH 2/5] f2fs: support norecovery mount option > > > > > > This patch adds a mount option, norecovery, which is mostly same as > > > disable_roll_forward. The only difference is that norecovery should be activated > > > with read-only mount option. > > > > > > This can be used when user wants to check whether f2fs is mountable or not > > > without any recovery process. (e.g., xfstests/200) > > > > > > Signed-off-by: Jaegeuk Kim > > > --- > > > fs/f2fs/super.c | 8 ++++++++ > > > 1 file changed, 8 insertions(+) > > > > > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > > > index fbc7f5a..0ca1fb2 100644 > > > --- a/fs/f2fs/super.c > > > +++ b/fs/f2fs/super.c > > > @@ -42,6 +42,7 @@ static struct kset *f2fs_kset; > > > enum { > > > Opt_gc_background, > > > Opt_disable_roll_forward, > > > + Opt_norecovery, > > > Opt_discard, > > > Opt_noheap, > > > Opt_user_xattr, > > > @@ -62,6 +63,7 @@ enum { > > > static match_table_t f2fs_tokens = { > > > {Opt_gc_background, "background_gc=%s"}, > > > {Opt_disable_roll_forward, "disable_roll_forward"}, > > > + {Opt_norecovery, "norecovery"}, > > > > IMO, it's better to show 'norecovery' in f2fs_show_options instead of showing > > 'disable_roll_forward', so user will know the details of mount option as we show. > > Hmm, I did think like that at the first time. > But, as you guess, this option is totally same as ro,disable_roll_forward. > So, I just wanted to avoid user's confusing for the behaviors of this option. All right, I just worry about that if users could not find the key word 'norecovery' in /etc/mtab as they think it should be there because they mount with it before. Not sure this will happen. > > > > > > {Opt_discard, "discard"}, > > > {Opt_noheap, "no_heap"}, > > > {Opt_user_xattr, "user_xattr"}, > > > @@ -287,6 +289,12 @@ static int parse_options(struct super_block *sb, char *options) > > > case Opt_disable_roll_forward: > > > set_opt(sbi, DISABLE_ROLL_FORWARD); > > > break; > > > + case Opt_norecovery: > > > + /* this option mounts f2fs with ro */ > > > + set_opt(sbi, DISABLE_ROLL_FORWARD); > > > > set_opt(sbi, NORECOVERY); and check this option before recover_fsync_data()? > > > > It's better to add description for this "norecovery" option in Documentation. > > I'll do that. It will really help our users. Thank you. :) Regards, > > Thanks, > > > > > Thanks, > > > > > + if (!f2fs_readonly(sb)) > > > + return -EINVAL; > > > + break; > > > case Opt_discard: > > > set_opt(sbi, DISCARD); > > > break; > > > -- > > > 2.1.1 > > > > > > -- > > > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > > > the body of a message to majordomo@vger.kernel.org > > > More majordomo info at http://vger.kernel.org/majordomo-info.html