linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aditya Kali <adityakali@google.com>
To: tytso@mit.edu, johann@whamcloud.com, linux-ext4@vger.kernel.org
Cc: Aditya Kali <adityakali@google.com>
Subject: [PATCH 2/4] libquota: fix quota_inode_truncate()
Date: Fri, 13 Jul 2012 15:25:07 -0700	[thread overview]
Message-ID: <1342218309-25983-2-git-send-email-adityakali@google.com> (raw)
In-Reply-To: <1342218309-25983-1-git-send-email-adityakali@google.com>

We failed to clear EXT2_FLAG_SUPER_ONLY after deleting the
quota inode and so, the updated block bitmap was not written
back. This caused fsck to complain after running
'tune2fs -O ^quota <dev>'. Clear this flag so that updated
block bitmap gets written. Also, avoid truncating the quota
inode if it is not hidden.

Signed-off-by: Aditya Kali <adityakali@google.com>
---
 lib/quota/quotaio.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
index c0ebaa1..7cdd653 100644
--- a/lib/quota/quotaio.c
+++ b/lib/quota/quotaio.c
@@ -133,14 +133,18 @@ errcode_t quota_inode_truncate(ext2_filsys fs, ext2_ino_t ino)
 	if ((err = ext2fs_read_inode(fs, ino, &inode)))
 		return err;
 
-	inode.i_dtime = fs->now ? fs->now : time(0);
-	if (!ext2fs_inode_has_valid_blocks2(fs, &inode))
-		return 0;
-
-	ext2fs_block_iterate3(fs, ino, BLOCK_FLAG_READ_ONLY, NULL,
-			      release_blocks_proc, NULL);

  reply	other threads:[~2012-07-13 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 22:25 [PATCH 1/4] tune2fs/quota: always create hidden quota files Aditya Kali
2012-07-13 22:25 ` Aditya Kali [this message]
2012-07-13 22:25 ` [PATCH 3/4] e2fsck/quota: mark FS invalid if quotas are not fixed Aditya Kali
2012-07-13 22:25 ` [PATCH 4/4] tune2fs: fix quota feature removal Aditya Kali
2012-07-17  5:22 ` [PATCH 1/4] tune2fs/quota: always create hidden quota files Theodore Ts'o

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=1342218309-25983-2-git-send-email-adityakali@google.com \
    --to=adityakali@google.com \
    --cc=johann@whamcloud.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).