]> git.pond.sub.org Git - empserver/commitdiff
Really fix setsector and setres not to wipe out concurrent updates
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Jan 2013 16:38:42 +0000 (17:38 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Jan 2013 16:56:34 +0000 (17:56 +0100)
setsector() and setres() continue after check_sect_ok() fails.
Clobbers the updates that made check_sect_ok() fail, triggering a
seqno mismatch oops.

Commit 04a332a8 (v4.3.27) claimed to fix this, but actually only
suppressed the generation oops.

src/lib/commands/setres.c
src/lib/commands/setsect.c

index 3d411abff1d7adfe79944ce2f0565d3625c0c223..e1b247eaa6b8411d1f41ef14ecd7cbf416fc1672 100644 (file)
@@ -68,7 +68,8 @@ setres(void)
            amt = 100;
        if (amt < 0)
            amt = 0;
-       check_sect_ok(&sect);
+       if (!check_sect_ok(&sect))
+           return RET_FAIL;
        switch (char0) {
        case 'i':
            if (sect.sct_own != 0)
index d9359d60b987c20ed4d5ccdafd740902dbced7c3..ab635580096958e12e9fa98b95932342b89488e8 100644 (file)
@@ -67,7 +67,8 @@ setsector(void)
        if (!p || !*p)
            return RET_SYN;
        amt = atoi(p);
-       check_sect_ok(&sect);
+       if (!check_sect_ok(&sect))
+           return RET_FAIL;
        switch (char0) {
        case 'i':
            current = sect.sct_min;