linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: jack@suse.cz, Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 2/2] ext4: add quota's error handling callback
Date: Mon,  5 Apr 2010 20:29:38 +0400	[thread overview]
Message-ID: <1270484978-17724-2-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1270484978-17724-1-git-send-email-dmonakhov@openvz.org>

quota is another type of metadata and quota inconsistency must
being handled properly.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 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


      reply	other threads:[~2010-04-05 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-05 16:29 [PATCH 1/2] RFC quota: add generic quota error handlers. v2 Dmitry Monakhov
2010-04-05 16:29 ` Dmitry Monakhov [this message]

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=1270484978-17724-2-git-send-email-dmonakhov@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@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).