]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.suse/ocfs2-Fix-grace-time-syncing.patch
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / ocfs2-Fix-grace-time-syncing.patch
1 From: Jan Kara <jack@suse.cz>
2 References: fate#302681
3 Subject: ocfs2: Fix grace time syncing
4 Patch-mainline: 2.6.29?
5
6 Fix syncing of grace times with other nodes. Previously, grace time could never
7 be reset to 0 even after user got below his softlimit.
8
9 Signed-off-by: Jan Kara <jack@suse.cz>
10
11 Index: linux-2.6.27/fs/ocfs2/quota_global.c
12 ===================================================================
13 --- linux-2.6.27.orig/fs/ocfs2/quota_global.c 2008-10-31 07:59:08.000000000 +0100
14 +++ linux-2.6.27/fs/ocfs2/quota_global.c 2008-10-31 08:03:32.000000000 +0100
15 @@ -418,22 +418,35 @@
16 dquot->dq_dqb.dqb_curspace += spacechange;
17 if (!test_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags))
18 dquot->dq_dqb.dqb_curinodes += inodechange;
19 - /* Now merge grace time changes... */
20 - if (!test_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags) &&
21 - oldbtime > 0) {
22 - if (dquot->dq_dqb.dqb_btime > 0)
23 - dquot->dq_dqb.dqb_btime =
24 + /* Set properly space grace time... */
25 + if (dquot->dq_dqb.dqb_bsoftlimit &&
26 + dquot->dq_dqb.dqb_curspace > dquot->dq_dqb.dqb_bsoftlimit) {
27 + if (!test_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags) &&
28 + oldbtime > 0) {
29 + if (dquot->dq_dqb.dqb_btime > 0)
30 + dquot->dq_dqb.dqb_btime =
31 min(dquot->dq_dqb.dqb_btime, oldbtime);
32 - else
33 - dquot->dq_dqb.dqb_btime = oldbtime;
34 - }
35 - if (!test_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags) &&
36 - olditime > 0) {
37 - if (dquot->dq_dqb.dqb_itime > 0)
38 - dquot->dq_dqb.dqb_itime =
39 + else
40 + dquot->dq_dqb.dqb_btime = oldbtime;
41 + }
42 + } else {
43 + dquot->dq_dqb.dqb_btime = 0;
44 + clear_bit(DQ_BLKS_B, &dquot->dq_flags);
45 + }
46 + /* Set properly inode grace time... */
47 + if (dquot->dq_dqb.dqb_isoftlimit &&
48 + dquot->dq_dqb.dqb_curinodes > dquot->dq_dqb.dqb_isoftlimit) {
49 + if (!test_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags) &&
50 + olditime > 0) {
51 + if (dquot->dq_dqb.dqb_itime > 0)
52 + dquot->dq_dqb.dqb_itime =
53 min(dquot->dq_dqb.dqb_itime, olditime);
54 - else
55 - dquot->dq_dqb.dqb_itime = olditime;
56 + else
57 + dquot->dq_dqb.dqb_itime = olditime;
58 + }
59 + } else {
60 + dquot->dq_dqb.dqb_itime = 0;
61 + clear_bit(DQ_INODES_B, &dquot->dq_flags);
62 }
63 /* All information is properly updated, clear the flags */
64 __clear_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags);