1 --- cluster-2.03.10/gfs2/libgfs2/ondisk.c.orig 2008-12-09 09:36:04.000000000 +0100
2 +++ cluster-2.03.10/gfs2/libgfs2/ondisk.c 2011-05-23 18:13:36.813924684 +0200
3 @@ -217,8 +217,7 @@ void gfs2_quota_in(struct gfs2_quota *qu
4 CPIN_64(qu, str, qu_limit);
5 CPIN_64(qu, str, qu_warn);
6 CPIN_64(qu, str, qu_value);
7 - CPIN_32(qu, str, qu_ll_next);
8 - CPIN_08(qu, str, qu_reserved, 60);
9 + CPIN_08(qu, str, qu_reserved, 64);
12 void gfs2_quota_out(struct gfs2_quota *qu, char *buf)
13 @@ -228,8 +227,7 @@ void gfs2_quota_out(struct gfs2_quota *q
14 CPOUT_64(qu, str, qu_limit);
15 CPOUT_64(qu, str, qu_warn);
16 CPOUT_64(qu, str, qu_value);
17 - CPOUT_32(qu, str, qu_ll_next);
18 - CPOUT_08(qu, str, qu_reserved, 60);
19 + CPOUT_08(qu, str, qu_reserved, 64);
22 void gfs2_quota_print(struct gfs2_quota *qu)
23 --- cluster-2.03.10/gfs2/quota/main.c.orig 2008-12-09 09:36:04.000000000 +0100
24 +++ cluster-2.03.10/gfs2/quota/main.c 2011-05-27 23:17:21.726106878 +0200
29 - * is_valid_quota_list - Check if we have a valid quota list
30 - * @fd: an open file descriptor of the quota file
34 -is_valid_quota_list(int fd)
36 - /* This is a slow test to determine if the quotas are in a
37 - * linked list. We should come up with something better
38 - * Quota linked list format is identified by the following.
39 - * step1: Get the maximum groupid and userid having valid
40 - * quotas in the quota file.
41 - * step2: Obtain the size of the quota file. The size of the
42 - * quota file (position of the last valid quota)
43 - * determines the last user/group id.
44 - * step3: If we can obtain the last valid quota through the
45 - * lists, then our lists are good. Else, the lists are
46 - * either corrupt or an older quota file format is in use
48 - int id_type = GQ_ID_GROUP;
49 - uint32_t id = 0, prev, ulast = 0, glast = 0, max;
50 - struct gfs2_quota q;
52 - get_last_quota_id(fd, &max);
55 - read_quota_internal(fd, id, id_type, &q);
60 - } while (id && id > prev);
62 - if (id && id <= prev)
65 - if (id_type == GQ_ID_GROUP)
70 - if (id_type == GQ_ID_GROUP) {
71 - id_type = GQ_ID_USER;
76 - if (glast != max && ulast != max)
83 -print_quota_list_warning()
85 - printf("\nWarning: This filesystem doesn't seem to have the new quota "
86 - "list format or the quota list is corrupt. list, check and init "
87 - "operation performance will suffer due to this. It is recommended "
88 - "that you run the 'gfs2_quota reset' operation to reset the quota "
89 - "file. All current quota information will be lost and you will "
90 - "have to reassign all quota limits and warnings\n\n");
94 - * adjust_quota_list - Adjust the quota linked list
95 - * @fd: The quota file descriptor
96 - * @comline: the struct containing the parsed command line arguments
99 -adjust_quota_list(int fd, commandline_t *comline)
101 - uint32_t prev = 0, next = 0, id = comline->id;
102 - struct gfs2_quota tmpq, q;
103 - int id_type = comline->id_type;
105 - if (id == 0) /* root quota, don't do anything */
107 - /* We just wrote the quota for id in do_set(). Get it */
110 - read_quota_internal(fd, next, id_type, &q);
112 - next = q.qu_ll_next;
113 - if (prev == id) /* no duplicates, bail */
115 - if (prev < id && id < next) /* gotcha! */
117 - } while(next && next > prev);
118 - read_quota_internal(fd, id, id_type, &tmpq);
119 - tmpq.qu_ll_next = next;
121 - write_quota_internal(fd, id, id_type, &tmpq);
122 - write_quota_internal(fd, prev, id_type, &q);
129 * do_reset - Reset all the quota data for a filesystem
130 * @comline: the struct containing the parsed command line arguments
135 read_quota_internal(fd, 0, GQ_ID_USER, &q);
137 write_quota_internal(fd, 0, GQ_ID_USER, &q);
139 read_quota_internal(fd, 0, GQ_ID_GROUP, &q);
141 write_quota_internal(fd, 0, GQ_ID_GROUP, &q);
143 /* truncate the quota file such that only the first
148 - if (!is_valid_quota_list(fd)) {
149 - print_quota_list_warning();
150 - goto do_old_school;
152 - get_last_quota_id(fd, &maxid);
154 - for (pass=0; pass<2; pass++) {
156 - id_type = pass ? GQ_ID_GROUP : GQ_ID_USER;
159 - read_quota_internal(fd, id, id_type, &q);
161 - if (q.qu_limit || q.qu_warn || q.qu_value)
162 - print_quota(comline,
163 - id_type == GQ_ID_USER ? TRUE : FALSE,
164 - id, &q, &sdp->sd_sb);
166 - } while(id && id > prev && id <= maxid);
171 for (pass=0; pass<2; pass++) {
175 offset += 2 * sizeof(struct gfs2_quota);
176 } while (error == sizeof(struct gfs2_quota));
180 close(sdp->metafs_fd);
186 - int error, adj_flag = 0;;
188 char quota_file[BUF_SIZE];
190 struct stat stat_buf;
195 - if (is_valid_quota_list(fd))
198 - print_quota_list_warning();
200 switch (comline->id_type) {
202 offset = (2 * (uint64_t)comline->id) * sizeof(struct gfs2_quota);
204 set_sysfs(fs, comline->id_type == GQ_ID_USER ?
205 "quota_refresh_user" : "quota_refresh_group", id_str);
208 - adjust_quota_list(fd, comline);
211 close(sdp->metafs_fd);
212 --- cluster-2.03.10/gfs2/quota/check.c.orig 2008-12-09 09:36:04.000000000 +0100
213 +++ cluster-2.03.10/gfs2/quota/check.c 2011-05-27 23:16:22.309438221 +0200
218 - if (!is_valid_quota_list(fd)) {
219 - print_quota_list_warning();
220 - goto do_old_school;
222 - get_last_quota_id(fd, &maxid);
224 - for (pass=0; pass<2; pass++) {
226 - id_type = pass ? GQ_ID_GROUP : GQ_ID_USER;
229 - read_quota_internal(fd, id, id_type, &q);
231 - q.qu_value <<= sdp->sd_sb.sb_bsize_shift - 9;
235 - add_value(gid, id, q.qu_value);
237 - add_value(uid, id, q.qu_value);
240 - } while(id && id > prev && id <= maxid);
247 memset(buf, 0, sizeof(struct gfs2_quota));
249 offset += sizeof(struct gfs2_quota);
250 } while (error == sizeof(struct gfs2_quota));
254 close(sdp->metafs_fd);