Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 1999 00:36:53 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Mike Dracopoulos <mdraco@math.uoa.gr>
Cc:        freebsd-questions@FreeBSD.ORG, freebsd-fs@FreeBSD.ORG
Subject:   Re: ext2fs access
Message-ID:  <Pine.BSF.4.10.9909290012040.7246-100000@alphplex.bde.org>
In-Reply-To: <199909251359.QAA00429@comet.db.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 1) The FreeBSD port of pine (both 3 & 4) cannot properly  access folders on 
> the ext2fs,  since the files get locked and remain so for some 5 minutes.
> This is NOT related with file permissions as, if I make $HOME/mail a
> symlink to a UFS directory, pine locks work just fine.
> 
> 2) "ls -l" does NOT report correctly on the number of links for ext2fs
> files and returns 0 for all.

Links in ext2fs were broken by the soft update changes.  A quick fix is
enclosed.  The fix is all in ffs and ufs, although the problem is that
ext2fs has too many hooks into ufs.  Having any hooks causes maintenance
problems.  Duplicating code would cause different maintenance problems.
There is a related bug for file flags (the immutable flags, etc.).
ufs_settatr() messes up ext2fs flags.

> I don't know enough about the locking mechanisms implemented in pine but
> my feeling is that these two problems may be related.

They do seem to be related.  pine seems to work with the links fixed here.

Bruce

diff -c2 sys/ufs/ffs/ffs_vfsops.c~ sys/ufs/ffs/ffs_vfsops.c
*** sys/ufs/ffs/ffs_vfsops.c~	Sun Sep 12 00:35:22 1999
--- sys/ufs/ffs/ffs_vfsops.c	Mon Sep 27 16:29:43 1999
***************
*** 660,666 ****
  	ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
  	bzero((caddr_t)ump, sizeof *ump);
  	ump->um_malloctype = malloctype;
! 	ump->um_fs = malloc((u_long)fs->fs_sbsize, M_UFSMNT,
! 	    M_WAITOK);
  	ump->um_blkatoff = ffs_blkatoff;
  	ump->um_truncate = ffs_truncate;
--- 651,657 ----
  	ump = malloc(sizeof *ump, M_UFSMNT, M_WAITOK);
  	bzero((caddr_t)ump, sizeof *ump);
+ 	ump->um_i_effnlink_valid = 1;
  	ump->um_malloctype = malloctype;
! 	ump->um_fs = malloc((u_long)fs->fs_sbsize, M_UFSMNT, M_WAITOK);
  	ump->um_blkatoff = ffs_blkatoff;
  	ump->um_truncate = ffs_truncate;
diff -c2 sys/ufs/ufs/ufs_vnops.c~ sys/ufs/ufs/ufs_vnops.c
*** sys/ufs/ufs/ufs_vnops.c~	Sun Aug 29 15:18:27 1999
--- sys/ufs/ufs/ufs_vnops.c	Mon Sep 27 16:32:21 1999
***************
*** 389,393 ****
  	vap->va_fileid = ip->i_number;
  	vap->va_mode = ip->i_mode & ~IFMT;
! 	vap->va_nlink = ip->i_effnlink;
  	vap->va_uid = ip->i_uid;
  	vap->va_gid = ip->i_gid;
--- 389,394 ----
  	vap->va_fileid = ip->i_number;
  	vap->va_mode = ip->i_mode & ~IFMT;
! 	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;
diff -c2 sys/ufs/ufs/ufsmount.h~ sys/ufs/ufs/ufsmount.h
*** sys/ufs/ufs/ufsmount.h~	Sun Aug 29 13:27:14 1999
--- sys/ufs/ufs/ufsmount.h	Mon Sep 27 16:23:43 1999
***************
*** 95,99 ****
  	struct	netexport um_export;		/* export information */
  	int64_t	um_savedmaxfilesize;		/* XXX - limit maxfilesize */
! 	struct malloc_type *um_malloctype;	/* The inodes malloctype */
  	int	(*um_blkatoff) __P((struct vnode *, off_t, char **, struct buf **));
  	int	(*um_truncate) __P((struct vnode *, off_t, int, struct ucred *, struct proc *));
--- 88,93 ----
  	struct	netexport um_export;		/* export information */
  	int64_t	um_savedmaxfilesize;		/* XXX - limit maxfilesize */
! 	struct	malloc_type *um_malloctype;	/* for inodes on this fs */
! 	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 *));



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9909290012040.7246-100000>