summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-11-03 12:05:39 +0000
committerbde <bde@FreeBSD.org>1999-11-03 12:05:39 +0000
commitd60ac1963ebc18f10982883db332b5256d7bc2de (patch)
treea651e13ac48890d0155fc25a3be13e0346be9c67
parentebbd3f872fe428977e8425d93a3102db4eff37fb (diff)
downloadFreeBSD-src-d60ac1963ebc18f10982883db332b5256d7bc2de.zip
FreeBSD-src-d60ac1963ebc18f10982883db332b5256d7bc2de.tar.gz
Quick fix for breakage of ext2fs link counts as reported by stat(2) by
the soft updates changes: only report the link count to be i_effnlink in ufs_getattr() for file systems that maintain i_effnlink. Tested by: Mike Dracopoulos <mdraco@math.uoa.gr>
-rw-r--r--sys/gnu/ext2fs/ext2_mount.h1
-rw-r--r--sys/gnu/fs/ext2fs/ext2_mount.h1
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c1
-rw-r--r--sys/ufs/ufs/ufs_vnops.c3
-rw-r--r--sys/ufs/ufs/ufsmount.h1
5 files changed, 6 insertions, 1 deletions
diff --git a/sys/gnu/ext2fs/ext2_mount.h b/sys/gnu/ext2fs/ext2_mount.h
index 4497454..05f19da 100644
--- a/sys/gnu/ext2fs/ext2_mount.h
+++ b/sys/gnu/ext2fs/ext2_mount.h
@@ -95,6 +95,7 @@ struct ufsmount {
struct netexport um_export; /* export information */
int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */
struct malloc_type *um_malloctype; /* The inodes malloctype */
+ int um_i_effnlink_valid; /* i_effnlink valid? */
int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
int (*um_update) __P((struct vnode *, int));
diff --git a/sys/gnu/fs/ext2fs/ext2_mount.h b/sys/gnu/fs/ext2fs/ext2_mount.h
index 4497454..05f19da 100644
--- a/sys/gnu/fs/ext2fs/ext2_mount.h
+++ b/sys/gnu/fs/ext2fs/ext2_mount.h
@@ -95,6 +95,7 @@ struct ufsmount {
struct netexport um_export; /* export information */
int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */
struct malloc_type *um_malloctype; /* The inodes malloctype */
+ int um_i_effnlink_valid; /* i_effnlink valid? */
int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
int (*um_update) __P((struct vnode *, int));
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index e133097..8786f10 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -648,6 +648,7 @@ ffs_mountfs(devvp, mp, p, malloctype)
ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
bzero((caddr_t)ump, sizeof *ump);
ump->um_malloctype = malloctype;
+ ump->um_i_effnlink_valid = 1;
ump->um_fs = malloc((u_long)fs->fs_sbsize, M_UFSMNT,
M_WAITOK);
ump->um_blkatoff = ffs_blkatoff;
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 5c79468..772987b 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -388,7 +388,8 @@ ufs_getattr(ap)
vap->va_fsid = dev2udev(ip->i_dev);
vap->va_fileid = ip->i_number;
vap->va_mode = ip->i_mode & ~IFMT;
- vap->va_nlink = ip->i_effnlink;
+ vap->va_nlink = VFSTOUFS(vp->v_mount)->um_i_effnlink_valid ?
+ ip->i_effnlink : ip->i_nlink;
vap->va_uid = ip->i_uid;
vap->va_gid = ip->i_gid;
vap->va_rdev = ip->i_rdev;
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index 4497454..05f19da 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -95,6 +95,7 @@ struct ufsmount {
struct netexport um_export; /* export information */
int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */
struct malloc_type *um_malloctype; /* The inodes malloctype */
+ int um_i_effnlink_valid; /* i_effnlink valid? */
int (*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
int (*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
int (*um_update) __P((struct vnode *, int));
OpenPOWER on IntegriCloud