From c544839b432a7a26a9f69e4cdb380f332eeb0cab Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Sat, 6 Jul 1996 17:28:09 +0000 Subject: (read_disknode): Don't set allocsize based on st->size for kludged symlinks. --- ufs/inode.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'ufs') diff --git a/ufs/inode.c b/ufs/inode.c index c3eec832..aa2f3a8c 100644 --- a/ufs/inode.c +++ b/ufs/inode.c @@ -270,10 +270,17 @@ read_disknode (struct node *np) if (!S_ISBLK (st->st_mode) && !S_ISCHR (st->st_mode)) st->st_rdev = 0; - if (lblkno (sblock, np->dn_stat.st_size) < NDADDR) - np->allocsize = fragroundup (sblock, np->dn_stat.st_size); + if (S_ISLNK (st->st_mode) + && direct_symlink_extension + && st->st_size < sblock->fs_maxsymlinklen) + np->allocsize = 0; else - np->allocsize = blkroundup (sblock, np->dn_stat.st_size); + { + if (lblkno (sblock, np->dn_stat.st_size) < NDADDR) + np->allocsize = fragroundup (sblock, st->st_size); + else + np->allocsize = blkroundup (sblock, st->st_size); + } return 0; } -- cgit v1.2.3