From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 4/6] ext3: handle errors in orphan_cleanup Date: Fri, 7 May 2010 18:59:29 +0200 Message-ID: <20100507165928.GH3700@quack.suse.cz> References: <1270749865-25441-1-git-send-email-dmonakhov@openvz.org> <1270749865-25441-2-git-send-email-dmonakhov@openvz.org> <1270749865-25441-3-git-send-email-dmonakhov@openvz.org> <1270749865-25441-4-git-send-email-dmonakhov@openvz.org> <1270749865-25441-5-git-send-email-dmonakhov@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, jack@suse.cz, hch@infradead.org, sandeen@redhat.com To: Dmitry Monakhov Return-path: Received: from cantor.suse.de ([195.135.220.2]:54555 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752790Ab0EGQ7c (ORCPT ); Fri, 7 May 2010 12:59:32 -0400 Content-Disposition: inline In-Reply-To: <1270749865-25441-5-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu 08-04-10 22:04:23, Dmitry Monakhov wrote: > Orphan cleanup procedure is complex task and may fail due to number > of reasons. Handle errors from orphan_cleanp according to > predefined per-sb errors behavior flags. > > Signed-off-by: Dmitry Monakhov > --- > fs/ext3/super.c | 29 ++++++++++++++++++++--------- > 1 files changed, 20 insertions(+), 9 deletions(-) > > diff --git a/fs/ext3/super.c b/fs/ext3/super.c > index e844acc..72d979a 100644 > --- a/fs/ext3/super.c > +++ b/fs/ext3/super.c > @@ -1460,11 +1461,14 @@ static void ext3_orphan_cleanup (struct super_block * sb, > /* Turn on quotas so that they are updated correctly */ > for (i = 0; i < MAXQUOTAS; i++) { > if (EXT3_SB(sb)->s_qf_names[i]) { > - int ret = ext3_quota_on_mount(sb, i); > - if (ret < 0) > + ret = ext3_quota_on_mount(sb, i); > + if (ret < 0) { > ext3_msg(sb, KERN_ERR, > "error: cannot turn on journaled " > "quota: %d", ret); > + if (!test_opt (sb, ERRORS_CONT)) > + goto out; > + } I see two consistent approaches: a) consider the filesystem is mounted and use ext3_handle_error() b) consider this a part of mounting procedure and return error and fail the mount. I would prefer b) but if you have some good arguments for a)... > } > } > #endif ... > @@ -1507,6 +1511,9 @@ static void ext3_orphan_cleanup (struct super_block * sb, > if (nr_truncates) > ext3_msg(sb, KERN_INFO, "%d truncate%s cleaned up", > PLURAL(nr_truncates)); > + if (ret) > + ext3_msg(sb, KERN_ERR, "Error %d wile orphan cleanup", ret); ^^^ while Honza -- Jan Kara SUSE Labs, CR