Hi,
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.
---
fs/hfs/extent.c | 3 ++-
fs/hfsplus/extents.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
Index: linux-2.6/fs/hfsplus/extents.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/extents.c 2005-07-31 19:22:29.000000000 +0200
+++ linux-2.6/fs/hfsplus/extents.c 2005-07-31 19:25:09.000000000 +0200
@@ -461,7 +461,9 @@ void hfsplus_file_truncate(struct inode
page_cache_release(page);
mark_inode_dirty(inode);
return;
- }
+ } else if (inode->i_size == HFSPLUS_I(inode).phys_size)
+ return;
+
blk_cnt = (inode->i_size + HFSPLUS_SB(sb).alloc_blksz - 1) >>
HFSPLUS_SB(sb).alloc_blksz_shift;
alloc_cnt = HFSPLUS_I(inode).alloc_blocks;
if (blk_cnt == alloc_cnt)
Index: linux-2.6/fs/hfs/extent.c
===================================================================
--- linux-2.6.orig/fs/hfs/extent.c 2005-07-31 19:22:27.000000000 +0200
+++ linux-2.6/fs/hfs/extent.c 2005-07-31 19:25:09.000000000 +0200
@@ -482,7 +482,8 @@ void hfs_file_truncate(struct inode *ino
page_cache_release(page);
mark_inode_dirty(inode);
return;
- }
+ } else if (inode->i_size == HFS_I(inode)->phys_size)
+ return;
size = inode->i_size + HFS_SB(sb)->alloc_blksz - 1;
blk_cnt = size / HFS_SB(sb)->alloc_blksz;
alloc_cnt = HFS_I(inode)->alloc_blocks;
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html