tree 2f0ad1e170f7f4bed6556c7679b32804c6d24102
parent 06c702a9ecb57d32faf873c3cb7b12f965edd2fd
author Niu YaWei <[EMAIL PROTECTED]> Tue Apr 12 08:26:15 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:26:15 2005
[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
===================================================================
--- 5dcd049742df93bafee9e2362457319906389490/fs/quota_v2.c (mode:100644
sha1:af383fa991aaaded2258dcc98f4b1a9f1e3a4cf0)
+++ 2f0ad1e170f7f4bed6556c7679b32804c6d24102/fs/quota_v2.c (mode:100644
sha1:9c09069db376da6ae49be830cb061a8f685cf4b8)
@@ -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