From 8ede88c32e86a8f507abc5ca9a12498a8a90a160 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 12 Aug 1996 20:36:17 +0000 Subject: (diskfs_truncate): For in-inode symlinks, just frob the size. --- ext2fs/truncate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ext2fs/truncate.c') diff --git a/ext2fs/truncate.c b/ext2fs/truncate.c index ebe8f374..6efe1a57 100644 --- a/ext2fs/truncate.c +++ b/ext2fs/truncate.c @@ -277,6 +277,17 @@ diskfs_truncate (struct node *node, off_t length) if (length >= node->dn_stat.st_size) return 0; + if (S_ISLNK (node->dn_stat.st_mode) && !node->dn_stat.st_blocks) + /* An in-inode symlink; there aren't really any blocks allocated, so + just frob the size. */ + { + node->dn_stat.st_size = length; + node->dn_set_mtime = 1; + node->dn_set_ctime = 1; + diskfs_node_update (node, 1); + return 0; + } + /* * If the file is not being truncated to a block boundary, the * contents of the partial block following the end of the file must be -- cgit v1.2.3