diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2005-08-02 00:11:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-02 00:38:00 -0400 |
commit | f76d28d235cf777dd2e1c1d48c16ee10c1d1587f (patch) | |
tree | e0f47d7b83276d91298326eb818e3de7fa32a2f2 /fs/hfs | |
parent | 0072b1389c25355ccc01048114adb9652c13fd9f (diff) |
[PATCH] hfs: don't dirty unchanged inode
If inode size hasn't changed, don't do anything further in truncate, which
also prevents a dirty inode, what might upset some readonly devices quite
badly.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hfs')
-rw-r--r-- | fs/hfs/extent.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index cbc8510ad222..5ea6b3d45eaa 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c | |||
@@ -482,7 +482,8 @@ void hfs_file_truncate(struct inode *inode) | |||
482 | page_cache_release(page); | 482 | page_cache_release(page); |
483 | mark_inode_dirty(inode); | 483 | mark_inode_dirty(inode); |
484 | return; | 484 | return; |
485 | } | 485 | } else if (inode->i_size == HFS_I(inode)->phys_size) |
486 | return; | ||
486 | size = inode->i_size + HFS_SB(sb)->alloc_blksz - 1; | 487 | size = inode->i_size + HFS_SB(sb)->alloc_blksz - 1; |
487 | blk_cnt = size / HFS_SB(sb)->alloc_blksz; | 488 | blk_cnt = size / HFS_SB(sb)->alloc_blksz; |
488 | alloc_cnt = HFS_I(inode)->alloc_blocks; | 489 | alloc_cnt = HFS_I(inode)->alloc_blocks; |