From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Monakhov Subject: [PATCH 2/2] ext4: add quota's error handling callback Date: Mon, 5 Apr 2010 20:29:38 +0400 Message-ID: <1270484978-17724-2-git-send-email-dmonakhov@openvz.org> References: <1270484978-17724-1-git-send-email-dmonakhov@openvz.org> Cc: jack@suse.cz, Dmitry Monakhov To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-bw0-f209.google.com ([209.85.218.209]:42612 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755228Ab0DEQ3p (ORCPT ); Mon, 5 Apr 2010 12:29:45 -0400 Received: by bwz1 with SMTP id 1so2896112bwz.21 for ; Mon, 05 Apr 2010 09:29:44 -0700 (PDT) In-Reply-To: <1270484978-17724-1-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: quota is another type of metadata and quota inconsistency must being handled properly. Signed-off-by: Dmitry Monakhov --- fs/ext4/super.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index edcf3b0..9113c16 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -999,6 +999,12 @@ static int bdev_try_to_free_page(struct super_block *sb, struct page *page, #define QTYPE2NAME(t) ((t) == USRQUOTA ? "user" : "group") #define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) +void ext4_handle_quota_error(struct super_block *sb, int type) +{ + ext4_error(sb, __func__, "Disk quota type:%s probably inconsistent.", + QTYPE2NAME(type)); +} + static int ext4_write_dquot(struct dquot *dquot); static int ext4_acquire_dquot(struct dquot *dquot); static int ext4_release_dquot(struct dquot *dquot); @@ -1023,6 +1029,7 @@ static const struct dquot_operations ext4_quota_operations = { .write_info = ext4_write_info, .alloc_dquot = dquot_alloc, .destroy_dquot = dquot_destroy, + .notify_error = ext4_handle_quota_error, }; static const struct quotactl_ops ext4_qctl_operations = { @@ -1032,7 +1039,7 @@ static const struct quotactl_ops ext4_qctl_operations = { .get_info = vfs_get_dqinfo, .set_info = vfs_set_dqinfo, .get_dqblk = vfs_get_dqblk, - .set_dqblk = vfs_set_dqblk + .set_dqblk = vfs_set_dqblk, }; #endif @@ -3915,7 +3922,7 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, handle_t *handle = journal_current_handle(); if (EXT4_SB(sb)->s_journal && !handle) { - ext4_msg(sb, KERN_WARNING, "Quota write (off=%llu, len=%llu)" + ext4_error(sb, KERN_WARNING, "Quota write (off=%llu, len=%llu)" " cancelled because transaction is not started", (unsigned long long)off, (unsigned long long)len); return -EIO; -- 1.6.6.1