From: Abhijith Das <adas@redhat.com> Date: Fri, 7 May 2010 00:08:09 -0400 Subject: [fs] gfs2: make quota file size a multiple of gfs2_quota Message-id: <188625765.174871273190889816.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Patchwork-id: 24893 O-Subject: [RHEL5.6 PATCH][GFS2] bz546455 - kernel bug: quota file size not a multiple of struct gfs2_quota Bugzilla: 546455 RH-Acked-by: Steven Whitehouse <swhiteho@redhat.com> RH-Acked-by: Robert S Peterson <rpeterso@redhat.com> This is the kernel portion of the fix that removes the quota linked-list related stuff from gfs2. The userland portion of this fix is already in RHEL5.5 (bug 536902) Resolves: rhbz#546455 Signed-off-by: Abhi Das <adas@redhat.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 8c01329..f201e0f 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -70,7 +70,6 @@ struct gfs2_quota_host { u64 qu_limit; u64 qu_warn; s64 qu_value; - u32 qu_ll_next; }; struct gfs2_quota_change_host { @@ -581,7 +580,6 @@ static void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf) qu->qu_limit = be64_to_cpu(str->qu_limit); qu->qu_warn = be64_to_cpu(str->qu_warn); qu->qu_value = be64_to_cpu(str->qu_value); - qu->qu_ll_next = be32_to_cpu(str->qu_ll_next); } /** diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index 14d0df0..c64ce50 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h @@ -173,43 +173,11 @@ struct gfs2_rgrp { __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ }; -/* - * quota linked list: user quotas and group quotas form two separate - * singly linked lists. ll_next stores uids or gids of next quotas in the - * linked list. - -Given the uid/gid, how to calculate the quota file offsets for the corresponding -gfs2_quota structures on disk: - -for user quotas, given uid, -offset = uid * sizeof(struct gfs2_quota); - -for group quotas, given gid, -offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota); - - - uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142 -+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+ -| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid | -+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+ -next:12 next:12 next:17 next:5142 next:NULL next:NULL - | | | | |<-- user quota list | - \______|___________/ \______|___________/ group quota list -->| - | | | - \__________________/ \_______________________________________/ - -*/ - -/* - * quota structure - */ - struct gfs2_quota { __be64 qu_limit; __be64 qu_warn; __be64 qu_value; - __be32 qu_ll_next; /* location of next quota in list */ - __u8 qu_reserved[60]; + __u8 qu_reserved[64]; }; /*