1. 04 Apr, 2008 2 commits
    • Linus Torvalds's avatar
      Be more careful about marking buffers dirty · 1be62dc1
      Linus Torvalds authored
      Mikulas Patocka noted that the optimization where we check if a buffer
      was already dirty (and we avoid re-dirtying it) was not really SMP-safe.
      
      Since the read of the old status was not synchronized with anything, an
      aggressive CPU re-ordering of memory accesses might have moved that read
      up to before the data was even written to the buffer, and another CPU
      that cleaned it again, causing the newly dirty state to never actually
      hit the disk.
      
      Admittedly this would probably never trigger in practice, but it's still
      wrong.
      
      Mikulas sent a patch that fixed the problem, but I dislike the subtlety
      of the whole optimization, so this is an alternate fix that is more
      explicit about the particular SMP ordering for the optimization, and
      separates out the speculative reads of the buffer state into its own
      conditional (and makes the memory barrier only happen if we are likely
      to actually hit the optimized case in the first place).
      
      I considered removing the optimization entirely, but Andrew argued for
      it's continued existence. I'm a push-over.
      
      Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1be62dc1
    • Linus Torvalds's avatar
      parport_pc: make sure to release IO ports after probing for IT87XX · 4ed91901
      Linus Torvalds authored
      Commit f63fd7e2 ("parport_pc: detection
      for SuperIO IT87XX POST") only released the IO port region on success,
      not when the probe for the IT87XX chip failed.
      
      That caused not only a reserved region to leak, but also caused an oops
      when the driver module was unloaded and somebody tried to cat
      /proc/ioports - because the string that was assigned to the IO port
      region was a static string in the module virtual address area.
      Reported-by: default avatarLubos Lunak <l.lunak@suse.cz>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Petr Cvek <petr.cvek@tul.cz>
      Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4ed91901
  2. 03 Apr, 2008 14 commits
  3. 02 Apr, 2008 24 commits