linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/4] f2fs: fix the recovery flow to handle errors correctly
Date: Mon, 25 Mar 2013 16:49:51 +0900	[thread overview]
Message-ID: <1364197791.29882.5.camel@kjgkr> (raw)
In-Reply-To: <CAKYAXd-999ACB+QNpOYXj=3WmH2OGYdrR9hpUn1WtpRCOJ8qiA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]

2013-03-25 (월), 15:30 +0900, Namjae Jeon:
> 2013/3/25, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
> > We should handle errors during the recovery flow correctly.
> > For example, if we get -ENOMEM, we should report a mount failure instead of
> > conducting the remained mount procedure.
> >
> > Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
> > ---
> >  fs/f2fs/f2fs.h     |  2 +-
> >  fs/f2fs/recovery.c | 46 ++++++++++++++++++++++++++++------------------
> >  fs/f2fs/super.c    |  9 +++++++--
> >  3 files changed, 36 insertions(+), 21 deletions(-)
> >
> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > index 5bb87e0..109e12d 100644
> > --- a/fs/f2fs/f2fs.h
> > +++ b/fs/f2fs/f2fs.h
> > @@ -1027,7 +1027,7 @@ void destroy_gc_caches(void);
> >  /*
> >   * recovery.c
> >   */
> > -void recover_fsync_data(struct f2fs_sb_info *);
> > +int recover_fsync_data(struct f2fs_sb_info *);
> >  bool space_for_roll_forward(struct f2fs_sb_info *);
> >
> >  /*
> > diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
> > index 2d86eb2..61bdaa7 100644
> > --- a/fs/f2fs/recovery.c
> > +++ b/fs/f2fs/recovery.c
> > @@ -118,10 +118,8 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi,
> > struct list_head *head)
> >
> >  		lock_page(page);
> >
> Hi Jaegeuk.
> I have a question.
> > -		if (cp_ver != cpver_of_node(page)) {
> > -			err = -EINVAL;
> > +		if (cp_ver != cpver_of_node(page))
> >  			goto unlock_out;
> > -		}
> err = 0 is initialized to zero in the start of function
> Why have you remove err = -EINVAL; code when mismatching cp_ver ?

This ending condition is used to find the latest node pages that we have
to recover, not to detect an error to exit the recovery routine.
For example, the error conditions include -ENOMEM or -EIO, something
like such the obvious errors.
Thanks,

> 
> Thanks.
> >
> --
> 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

-- 
Jaegeuk Kim
Samsung

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-03-25  7:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-24 23:40 [PATCH 1/4] f2fs: fix the recovery flow to handle errors correctly Jaegeuk Kim
2013-03-24 23:40 ` [PATCH 2/4] f2fs: do not skip writing file meta during fsync Jaegeuk Kim
2013-03-26  0:48   ` Namjae Jeon
2013-03-27  0:18     ` Jaegeuk Kim
2013-03-27  0:57       ` Namjae Jeon
2013-03-27  1:18         ` Jaegeuk Kim
2013-03-27  1:28           ` Namjae Jeon
2013-03-24 23:40 ` [PATCH 3/4] f2fs: remain nat cache entries for further free nid allocation Jaegeuk Kim
2013-03-26  0:49   ` Namjae Jeon
2013-03-24 23:40 ` [PATCH 4/4] f2fs: fix to give correct parent inode number for roll forward Jaegeuk Kim
2013-03-27  1:34   ` Namjae Jeon
2013-03-25  6:30 ` [PATCH 1/4] f2fs: fix the recovery flow to handle errors correctly Namjae Jeon
2013-03-25  7:49   ` Jaegeuk Kim [this message]
2013-03-26  0:44     ` Namjae Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364197791.29882.5.camel@kjgkr \
    --to=jaegeuk.kim@samsung.com \
    --cc=linkinjeon@gmail.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).