lkml.org 
[lkml]   [2002]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.5 [8 of 8] 08-truncate_update_mtime.diff
Hello!

truncate now correctly sets mtime always. Before this fix, mtime was not
updated if truncated file was of zero length or if new filesize was bigger
then old.
Problem was noticed by Matthias Andree <ma@dt.e-technik.uni-dortmund.de>


--- linux/fs/reiserfs/stree.c.orig Mon Feb 11 16:43:26 2002
+++ linux/fs/reiserfs/stree.c Mon Feb 11 16:43:41 2002
@@ -1705,8 +1705,7 @@
}

if ( n_file_size == 0 || n_file_size < n_new_file_size ) {
- pathrelse(&s_search_path);
- return;
+ goto update_and_out ;
}

/* Update key to search for the last file item. */
@@ -1759,6 +1758,7 @@
"PAP-5680: truncate did not finish: new_file_size %Ld, current %Ld, oid %d\n",
n_new_file_size, n_file_size, s_item_key.on_disk_key.k_objectid);

+update_and_out:
if (update_timestamps) {
// this is truncate, not file closing
p_s_inode->i_mtime = p_s_inode->i_ctime = CURRENT_TIME;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.025 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site