From e3c631340383719f6f0237fd24121b73284b01e2 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 15 Aug 1996 21:28:20 +0000 Subject: (diskfs_truncate): Allow any sort of node to have a size without any blocks (as linux apparently does this sometimes with devices). --- ext2fs/truncate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext2fs/truncate.c b/ext2fs/truncate.c index 6efe1a57..63cc7340 100644 --- a/ext2fs/truncate.c +++ b/ext2fs/truncate.c @@ -277,9 +277,10 @@ 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. */ + if (! node->dn_stat.st_blocks) + /* There aren't really any blocks allocated, so just frob the size. This + is true for fast symlinks, and also apparently for some device nodes + in linux. */ { node->dn_stat.st_size = length; node->dn_set_mtime = 1; -- cgit v1.2.3