[PATCH] Revised fix for download corruption

From: Phil Oester <kernel@dont-contact.us>
Date: Mon, 4 Nov 2002 13:47:04 -0800

Since I sent in my patch last week, I've discovered a few things:

1) at least one squid devloper questions my sanity on the squid-dev list:

"This person is .. insane. Insane, insane, insane"

2) the patch was only partially correct. The problem only occurs on a cancelled READ, not on a write. Many times, due to write latency, flags->close_request has been set on a write before the data has been committed to disk. My original patch would cancel on writes also, so I ended up with a bunch of zero byte files in my cache.

The below works for both reads and writes, as it only checks close_request for reads before returning the results to the client.

-Phil Oester
(no, I'm not insane!)

diff -ru original/src/fs/aufs/store_io_aufs.c fixed/src/fs/aufs/store_io_aufs.c
--- original/src/fs/aufs/store_io_aufs.c Sun Aug 11 16:14:35 2002
+++ fixed/src/fs/aufs/store_io_aufs.c Mon Nov 4 13:44:21 2002
@@ -290,6 +290,11 @@
        if (storeAufsKickWriteQueue(sio))
            return;
     } else if (FILE_MODE(sio->mode) == O_RDONLY) {
+ if (aiostate->flags.close_request) {
+ debug(79, 3) ("storeAufsOpenDone: closed read request aborted\n");
+ storeAufsIOCallback(sio, errflag);
+ return;
+ }
        if (storeAufsKickReadQueue(sio))
            return;
     }
Received on Mon Nov 04 2002 - 14:47:10 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:11:08 MST