From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaegeuk Kim Subject: Re: [PATCH] f2fs: prevent checkpoint once any IO failure is detected Date: Thu, 24 Jan 2013 17:09:53 +0900 Message-ID: <1359014993.22847.8.camel@kjgkr> References: <1359025132-22577-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="=-VDRyxAmi3QhNjS4pLYHL" Cc: oliver@oli1170.net, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net To: Namjae Jeon Return-path: Received: from mailout2.samsung.com ([203.254.224.25]:45396 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777Ab3AXIKR (ORCPT ); Thu, 24 Jan 2013 03:10:17 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MH4006Q2EOE6HM0@mailout2.samsung.com> for linux-fsdevel@vger.kernel.org; Thu, 24 Jan 2013 17:10:15 +0900 (KST) Received: from [12.52.126.105] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MH400FT7EP39370@mmp2.samsung.com> for linux-fsdevel@vger.kernel.org; Thu, 24 Jan 2013 17:10:15 +0900 (KST) In-reply-to: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --=-VDRyxAmi3QhNjS4pLYHL Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, 2013-01-24 (=EB=AA=A9), 15:37 +0900, Namjae Jeon: > 2013/1/24, Jaegeuk Kim : > > This patch enhances the checkpoint routine to cope with IO errors. > > > > Basically f2fs detects IO errors from end_io_write, and the errors are = able > > to > > be occurred during one of data, node, and meta page writes. > > > > In the previous code, when an IO error is occurred during writes, f2fs = sets > > a > > flag, CP_ERROR_FLAG, in the raw ckeckpoint buffer which will be written= to > > disk. > > Afterwards, write_checkpoint() will check the flag and remount f2fs as = a > > read-only (ro) mode. > > > > However, even once f2fs is remounted as a ro mode, dirty checkpoint pag= es > > are > > freely able to be written to disk by flusher or kswapd in background. > > In such a case, after cold reboot, f2fs would restore the checkpoint da= ta > > having > > CP_ERROR_FLAG, resulting in disabling write_checkpoint and remounting f= 2fs > > as > > a ro mode again. > > > > Therefore, let's prevent any checkpoint page (meta) writes once an IO e= rror > > is > > occurred, and remount f2fs as a ro mode right away at that moment. > Hi Jaegeuk. > 1. there is no meaingful return type in write_meta_page. how about > change void function prototype ? Agreed. > 2. "A bug case: need to run fsck" =3D> what is fsck ? Is there fsck for f= 2fs ? We've developing a very naive fsck tool, but it's too messy to release now. I hope to release it within a couple of months later. BTW, I think it is no problem to add such a comment since fsck should be implemented whether it exists or not. > 3. do_checkpoint()->sync_meta_pages()-> > while (index <=3D end) { > int i, nr_pages; > nr_pages =3D pagevec_lookup_tag(&pvec, mapping, &index, > PAGECACHE_TAG_DIRTY, > min(end - index, (pgoff_t)PAGEVEC_SIZE-1)= + 1); > if (nr_pages =3D=3D 0) > break; >=20 > for (i =3D 0; i < nr_pages; i++) { > struct page *page =3D pvec.pages[i]; > lock_page(page); > BUG_ON(page->mapping !=3D mapping); > BUG_ON(!PageDirty(page)); > clear_page_dirty_for_io(page); > f2fs_write_meta_page(page, &wbc); -> At this > point error need to be handled ? Agreed. I'll send v2. Thank you for reviewing. :) --=20 Jaegeuk Kim Samsung --=-VDRyxAmi3QhNjS4pLYHL 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) iQIcBAABAgAGBQJRAOxRAAoJEEAUqH6CSFDSyf4P/3FfMvMR7fyucDtuDkv1zpRi /mVIXK6fY5ABbCjdx0I9t5l6m4UOWvtV6ApKrbc9noBj/eChtmX9J7of3CiDHfF7 hXbzQj3dKU5ymOP3A7GDzWbOUUHHrmNUCZJOiPW/gNz9Qdf5G+Zx2V7VtPYGQHH6 QKJyi3lBE0sqxDeWTr4fRIekpFfbrhmVTputBpBA6MRtlkHjGnDV/YP7ZWFGYOox icwQVJeV4Ni+JJjyPSHFSvn47/f5tZZuB2fo5Ub4Rq6y2FjXIPOUJMWreS/vkwbP oa2Z5t0osevfmKIiSusJ+3CQeiobjvqpKtkcpOkV884XVZlP7K1r8Yc8EtEFzJ9g jrzE2H7042ntv8zFNvTUqzzNmu4TgQGFvNlEJfHVFNYscoyBFbYyd06CYJDGdBxE 9luVDFNUKxqngR/4GWpDe2WSl1KuPOGDnyKFxjQhbJTNKBgggfJLg+FHFhrfd99R vqGGD+7K71RZJQwkx/khIAHEVVmeypC+hJc3/uEyn9oUdY8v4Slg5uwwxgWF+7hd x0HTF9tSDgmvKAzPNNQKHz6oWVsO1YC1E74MDp3xWLAXVzrhiF1yyIzr+sVi5bMS VuK5U+cmEpukji7nijRp+CZeEl6gMWuLgc/u/ZMQLlmt+xWDxGLsRj26kZZqyjaP evSb4Gb96sFeb2lklicE =eWX9 -----END PGP SIGNATURE----- --=-VDRyxAmi3QhNjS4pLYHL--