linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] hfs: don't dirty unchanged inode
@ 2005-08-01  9:42 Roman Zippel
  2005-08-01  9:49 ` Roman Zippel
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Zippel @ 2005-08-01  9:42 UTC (permalink / raw)
  To: Andrew Morton, linux-fsdevel

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/5] hfs: don't dirty unchanged inode
  2005-08-01  9:42 [PATCH 1/5] hfs: don't dirty unchanged inode Roman Zippel
@ 2005-08-01  9:49 ` Roman Zippel
  0 siblings, 0 replies; 2+ messages in thread
From: Roman Zippel @ 2005-08-01  9:49 UTC (permalink / raw)
  To: Andrew Morton, linux-fsdevel

Hi,

On Mon, 1 Aug 2005, Roman Zippel wrote:

> 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.

Sorry, I forgot this:

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

Andrew, the first two patches are also the most important and should go 
into 2.6.13.

bye, Roman

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-01  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-01  9:42 [PATCH 1/5] hfs: don't dirty unchanged inode Roman Zippel
2005-08-01  9:49 ` Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).