caches-queues-lists: fix bug caused by new seq_queue implementation

When adding the seq_queue implementation I did not want to
increase the existing size of struct file_buffer.  This meant
I needed to reuse fields that are not used at the time the
file_buffer is being enqueued to the seq_queue.

The seq_queue implementation was intended to use the free_prev
and free_next pointers, as they're guaranteed not to be used (they're
used to keep track of free buffers in the caches, which
by definition as the buffer is in use, these fields are not in use).
Unfortunately, when turning the hash functions into macros I
forgot to do this!  With the consequence the seq_queue has been
re-using the hash_next and hash_prev pointers, which are already
in use if the buffer being queued is compressed (and by definition
stored hashed in the write cache).

Because the effect of this is to mutually corrupt the hash lists,
this causes subtle failures in lookup which largely do not
cause mksquashfs to fail.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
3 files changed
tree: 98ad990e34df0461134b70f2f2a6b2ec20f6b7e2
  1. kernel/
  2. kernel-2.4/
  3. squashfs-tools/
  4. README