linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: akpm@osdl.org
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, niu@clusterfs.com,
	jack@suse.cz
Subject: [patch 132/198] quota: possible bug in quota format v2 support
Date: Tue, 12 Apr 2005 03:32:39 -0700	[thread overview]
Message-ID: <200504121032.j3CAWj6x005668@shell0.pdx.osdl.net> (raw)


From: Niu YaWei <niu@clusterfs.com>

Don't put root block of quota tree to the free list (when quota file is
completely empty).  That should not actually happen anyway (somebody should
get accounted for the filesystem root and so quota file should never be
empty) but better prevent it here than solve magical quota file
corruption.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/quota_v2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/quota_v2.c~quota-possible-bug-in-quota-format-v2-support fs/quota_v2.c
--- 25/fs/quota_v2.c~quota-possible-bug-in-quota-format-v2-support	2005-04-12 03:21:35.447748024 -0700
+++ 25-akpm/fs/quota_v2.c	2005-04-12 03:21:35.450747568 -0700
@@ -503,7 +503,8 @@ static int remove_tree(struct dquot *dqu
 		int i;
 		ref[GETIDINDEX(dquot->dq_id, depth)] = cpu_to_le32(0);
 		for (i = 0; i < V2_DQBLKSIZE && !buf[i]; i++);	/* Block got empty? */
-		if (i == V2_DQBLKSIZE) {
+		/* Don't put the root block into the free block list */
+		if (i == V2_DQBLKSIZE && *blk != V2_DQTREEOFF) {
 			put_free_dqblk(sb, type, buf, *blk);
 			*blk = 0;
 		}
_

                 reply	other threads:[~2005-04-12 18:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200504121032.j3CAWj6x005668@shell0.pdx.osdl.net \
    --to=akpm@osdl.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niu@clusterfs.com \
    --cc=torvalds@osdl.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).