• Evgeniy Dushistov's avatar
    [PATCH] ufs: truncate correction · ecdc6394
    Evgeniy Dushistov authored
    1) When we allocated last fragment in ufs_truncate, we read page, check
       if block mapped to address, and if not trying to allocate it.  This is
       wrong behaviour, fragment may be NOT allocated, but mapped, this
       happened because of "block map" function not checked allocated fragment
       or not, it just take address of the first fragment in the block, add
       offset of fragment and return result, this is correct behaviour in
       almost all situation except call from ufs_truncate.
    
    2) Almost all implementation of UFS, which I can investigate have such
       "defect": if you have full disk, and try truncate file, for example 3GB
       to 2MB, and have hole in this region, truncate return -ENOSPC.  I tried
       evade from this problem, but "block allocation" algorithm is tied to
       right value of i_lastfrag, and fix of this corner case may slow down of
       ordinaries scenarios, so this patch makes behavior of "truncate"
       operations similar to what other UFS implementations do.
    Signed-off-by: default avatarEvgeniy Dushistov <dushistov@mail.ru>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    ecdc6394
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
usr Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...