aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/inode.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2007-03-16 17:38:09 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-16 22:25:03 -0400
commit4b25a37e2093146c1f9aa436b832b7d4ef880ca4 (patch)
tree435db82996e6114eea94f8315c699c7c9904615b /fs/ufs/inode.c
parent5431bf97ce69065ed07de1ff12543d0800817b83 (diff)
[PATCH] ufs: zeroize the rest of block in truncate
This patch fix behaviour in such test scenario: lseek(fd, BIG_OFFSET) write(fd, buf, sizeof(buf)) truncate(BIG_OFFSET) truncate(BIG_OFFSET + sizeof(buf)) read(fd, buf...) Because of if file big enough(BIG_OFFSET) we start allocate space by block, ordinary block size > page size, so we should zeroize the rest of block in truncate(except last framgnet, about which VFS should care), to not get garbage, when we extend file. Also patch corrects conversion from pointer to block to physical block number, this helps in case of not common used UFS types. And add to debug output inode number. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ufs/inode.c')
-rw-r--r--fs/ufs/inode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index 366618dd698d..013d7afe7cde 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -212,7 +212,7 @@ repeat:
212 brelse (result); 212 brelse (result);
213 goto repeat; 213 goto repeat;
214 } else { 214 } else {
215 *phys = tmp + blockoff; 215 *phys = uspi->s_sbbase + tmp + blockoff;
216 return NULL; 216 return NULL;
217 } 217 }
218 } 218 }
@@ -282,9 +282,9 @@ repeat:
282 } 282 }
283 283
284 if (!phys) { 284 if (!phys) {
285 result = sb_getblk(sb, tmp + blockoff); 285 result = sb_getblk(sb, uspi->s_sbbase + tmp + blockoff);
286 } else { 286 } else {
287 *phys = tmp + blockoff; 287 *phys = uspi->s_sbbase + tmp + blockoff;
288 result = NULL; 288 result = NULL;
289 *err = 0; 289 *err = 0;
290 *new = 1; 290 *new = 1;
@@ -368,7 +368,7 @@ repeat:
368 brelse (result); 368 brelse (result);
369 goto repeat; 369 goto repeat;
370 } else { 370 } else {
371 *phys = tmp + blockoff; 371 *phys = uspi->s_sbbase + tmp + blockoff;
372 goto out; 372 goto out;
373 } 373 }
374 } 374 }
@@ -389,9 +389,9 @@ repeat:
389 389
390 390
391 if (!phys) { 391 if (!phys) {
392 result = sb_getblk(sb, tmp + blockoff); 392 result = sb_getblk(sb, uspi->s_sbbase + tmp + blockoff);
393 } else { 393 } else {
394 *phys = tmp + blockoff; 394 *phys = uspi->s_sbbase + tmp + blockoff;
395 *new = 1; 395 *new = 1;
396 } 396 }
397 397