diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-07-06 17:28:09 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-07-06 17:28:09 +0000 |
commit | c544839b432a7a26a9f69e4cdb380f332eeb0cab (patch) | |
tree | 21eeb98064774b7e1e0fa32fb8033de12fb90dc3 | |
parent | 0fefc2a7f86355f09e6b4124c028b639122e2b13 (diff) |
(read_disknode): Don't set allocsize based on st->size for kludged
symlinks.
-rw-r--r-- | ufs/inode.c | 13 |
1 files changed, 10 insertions, 3 deletions
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; } |