From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaegeuk Kim Subject: Re: [PATCH 1/4] f2fs: fix the recovery flow to handle errors correctly Date: Mon, 25 Mar 2013 16:49:51 +0900 Message-ID: <1364197791.29882.5.camel@kjgkr> References: <1364168414-12815-1-git-send-email-jaegeuk.kim@samsung.com> Reply-To: jaegeuk.kim@samsung.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ZIR4ytBvMOqTRxIlyQUk" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net To: Namjae Jeon Return-path: In-reply-to: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --=-ZIR4ytBvMOqTRxIlyQUk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2013-03-25 (=EC=9B=94), 15:30 +0900, Namjae Jeon: > 2013/3/25, Jaegeuk Kim : > > We should handle errors during the recovery flow correctly. > > For example, if we get -ENOMEM, we should report a mount failure instea= d of > > conducting the remained mount procedure. > > > > Signed-off-by: Jaegeuk Kim > > --- > > 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 !=3D cpver_of_node(page)) { > > - err =3D -EINVAL; > > + if (cp_ver !=3D cpver_of_node(page)) > > goto unlock_out; > > - } > err =3D 0 is initialized to zero in the start of function > Why have you remove err =3D -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, >=20 > 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 --=20 Jaegeuk Kim Samsung --=-ZIR4ytBvMOqTRxIlyQUk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJRUAGfAAoJEEAUqH6CSFDS9VIQAIm2DH7GWiR2iV2H5PfTg2hd 3Uqt5cdpdIqxXKc3DEjumSUjpkQmUBu0WolCMyDnq2H4r7jJ5W/rWP5tdILPJ6VE FheuAFAGDdAi+02jrPC2QvPAv5xI9tiKIkbIy3F1J71ocMhd30okZuwZ0PsjH8H/ b7QMhpMGcgLf7lfNTqLZ7VciZwOPi5cfa7ISpArLjkwvIrMhS5SS7mJqgsFfS8H7 Qg6mlvHRGSKIhwERjdHSVms4kJMsMpAWhRkW5VwWKcOBEQzgYrnV6aoslr7kEPuu XDZXa7+1cry4gcwS23GxdDeq7EY8aVAgjqJUmOD2QZ/wU1XrSLVgm2XJ5a1ap1OF /S93V+EC2TMLzLdNXL2utqwO4NiH/3B56IPtAYn2HPDdXM5BptAh2kuvjadB5ymB Q+ZPwEZonrvNtLgWIpsyo4osn/8/Ki5iNpm6jifyetIytTNx/aUQT/xudb+HiZ3Q 99WxgBK08ZXymKPIad7bQW9jaif45po53E94jwX9ovHjCAgTsi4NDRBBfiYX5eXR cY3cpibeUGe02psx4ZhlEXo+CGenkXioPEbFnvOn8OmW2V6FmaocHZzOmN5fzzeD lLwHCg5Kw6QsfDMj2KVNFyEyB8tzc9CmQ1oBbozrhMEebriFsYlD4tF8n6tEuecb 7WAqaLwwmM4v/G4ED6FY =sBIl -----END PGP SIGNATURE----- --=-ZIR4ytBvMOqTRxIlyQUk--