tree cb753d2d4e45c02c4c006383fa4d5d8dfba7a3c6
parent 31e7ad6ac919761f0486f7781b02ff3ab54b6ef1
author Niu YaWei <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:47 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:47 -0700

[PATCH] quota: possible bug in quota format v2 support

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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

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

Index: fs/quota_v2.c
===================================================================
--- 1101585d46faf72c0bec070c8206f20455651805/fs/quota_v2.c  (mode:100644 
sha1:19bdb7b86ca77b436b63f8dc6f0dbf5493bc4b36)
+++ cb753d2d4e45c02c4c006383fa4d5d8dfba7a3c6/fs/quota_v2.c  (mode:100644 
sha1:7afcbb1b93761a539ddb8d31f4448b122f6f5e6b)
@@ -503,7 +503,8 @@
                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;
                }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to