]> git.baikalelectronics.ru Git - kernel.git/commit
fs: fix data-loss on error
authorNick Piggin <npiggin@suse.de>
Tue, 16 Oct 2007 08:25:00 +0000 (01:25 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:42:55 +0000 (09:42 -0700)
commit23c5f468859839b9bfa33a8ea4aac6d14de9f67f
tree837fb3196236998c3c3ae44762ed3167ef0256f4
parent2acaaf1b6c6aa1f613d3cbde5c046db6a795eda3
fs: fix data-loss on error

New buffers against uptodate pages are simply be marked uptodate, while the
buffer_new bit remains set.  This causes error-case code to zero out parts of
those buffers because it thinks they contain stale data: wrong, they are
actually uptodate so this is a data loss situation.

Fix this by actually clearning buffer_new and marking the buffer dirty.  It
makes sense to always clear buffer_new before setting a buffer uptodate.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/buffer.c