ReiserFS file write bug fix for 2.4
Well, at least getting the new file write code into pre6 found this bug for us.... please apply.
Hello!
You probably want to ask Marcelo if he is going to leave reiserfs_file_write stuff in kernel. If he is going to do that, then attached fix should be applied. Otherwise it can be ignored, of course.
Bye,
Oleg
Hello!
This fixes a buglet in new reiserfs_file_write() that escaped out previous tests. Problem only occurs on non-empty appended (opened with O_APPEND) files that are being written with more than 128k bytes data at a time (write syscall). Fix itself is trivial.
Diffstat:
file.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
Plain text patch:
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.632 -> 1.633
# fs/reiserfs/file.c 1.10 -> 1.11
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/11 [email protected] 1.633
# reiserfs: Fix a case where non empty files written to with O_APPEND set and amount of bytes to write bigger than 128k (or up to 4k less for non page aligned writes) can get their content damaged. # --------------------------------------------
#
fs/reiserfs/file.c +1 -1
@@ -1189,7 +1189,7 @@ already_written += write_bytes; buf += write_bytes; - pos = *ppos += write_bytes; + *ppos = pos += write_bytes; count -= write_bytes; }
Quoted 2 lines · Hans Reiser
Well, at least getting the new file write code into pre6 found this bug for us.... please apply.
What is the "right" way to get the new block allocation going? The mount option (-o alloc=prealloc min=4:preallocsize=9) only or better a "reformat"?
Thanks,
Dieter
Signature · 6 lines
Dieter Nützel Graduate Student, Computer Science University of Hamburg Department of Computer Science @home: Dieter.Nuetzel at hamburg.de (replace at with @)
Hello!
Quoted 4 lines · Dieter N?tzel
Quoted 2 lines · Hans Reiser
Well, at least getting the new file write code into pre6 found this bug for us.... please apply.
What is the "right" way to get the new block allocation going?
use 2.4.19-pre2+ and it is in there ;)
Quoted 2 lines
The mount option (-o alloc=prealloc min=4:preallocsize=9) only or better a "reformat"?
Those mount options are no longer needed starting from 2.4.20-pre6. They are default. Reformat is not needed, but all the blocks allocated by old allocator will remain at their old places of course.
Bye,
Oleg
Quoted 10 lines · Oleg Drokin
Hello!
Quoted 5 lines · Dieter N?tzel
Quoted 2 lines · Hans Reiser
Well, at least getting the new file write code into pre6 found this bug for us.... please apply.
What is the "right" way to get the new block allocation going?
use 2.4.19-pre2+ and it is in there ;)
You meant 2.4.20-pre2, didn't you?
Quoted 9 lines
Quoted 2 lines
The mount option (-o alloc=prealloc min=4:preallocsize=9) only or better a "reformat"?
Those mount options are no longer needed starting from 2.4.20-pre6. They are default. Reformat is not needed, but all the blocks allocated by old allocator will remain at their old places of course.
Bye,
Oleg
Signature · 6 lines
Dieter Nützel Graduate Student, Computer Science University of Hamburg Department of Computer Science @home: Dieter.Nuetzel at hamburg.de (replace at with @)
Hello!
Quoted 7 lines · Dieter N?tzel
Quoted 6 lines · Dieter N?tzel
Quoted 4 lines · Hans Reiser
Quoted 2 lines
Well, at least getting the new file write code into pre6 found this bug for us.... please apply.
What is the "right" way to get the new block allocation going?
use 2.4.19-pre2+ and it is in there ;)
You meant 2.4.20-pre2, didn't you?
Ah, yes. 2.4.20-pre2+ of course.
Bye,
Oleg