Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Sep 2016 10:42:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r306175 - stable/10/sys/ufs/ffs
Message-ID:  <201609221042.u8MAge6p054030@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Sep 22 10:42:40 2016
New Revision: 306175
URL: https://svnweb.freebsd.org/changeset/base/306175

Log:
  MFC r305592:
  Partially lift suspension when ffs_reload() finished with cgs and
  going to re-read inodes.

Modified:
  stable/10/sys/ufs/ffs/ffs_extern.h
  stable/10/sys/ufs/ffs/ffs_suspend.c
  stable/10/sys/ufs/ffs/ffs_vfsops.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ufs/ffs/ffs_extern.h
==============================================================================
--- stable/10/sys/ufs/ffs/ffs_extern.h	Thu Sep 22 09:58:46 2016	(r306174)
+++ stable/10/sys/ufs/ffs/ffs_extern.h	Thu Sep 22 10:42:40 2016	(r306175)
@@ -107,6 +107,9 @@ void	ffs_susp_uninitialize(void);
 
 #define	FFSV_FORCEINSMQ	0x0001
 
+#define	FFSR_FORCE	0x0001
+#define	FFSR_UNSUSPEND	0x0002
+
 extern struct vop_vector ffs_vnodeops1;
 extern struct vop_vector ffs_fifoops1;
 extern struct vop_vector ffs_vnodeops2;

Modified: stable/10/sys/ufs/ffs/ffs_suspend.c
==============================================================================
--- stable/10/sys/ufs/ffs/ffs_suspend.c	Thu Sep 22 09:58:46 2016	(r306174)
+++ stable/10/sys/ufs/ffs/ffs_suspend.c	Thu Sep 22 10:42:40 2016	(r306175)
@@ -234,7 +234,7 @@ ffs_susp_dtor(void *data)
 	KASSERT((mp->mnt_kern_flag & MNTK_SUSPEND) != 0,
 	    ("MNTK_SUSPEND not set"));
 
-	error = ffs_reload(mp, curthread, 1);
+	error = ffs_reload(mp, curthread, FFSR_FORCE | FFSR_UNSUSPEND);
 	if (error != 0)
 		panic("failed to unsuspend writes on %s", fs->fs_fsmnt);
 

Modified: stable/10/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/10/sys/ufs/ffs/ffs_vfsops.c	Thu Sep 22 09:58:46 2016	(r306174)
+++ stable/10/sys/ufs/ffs/ffs_vfsops.c	Thu Sep 22 10:42:40 2016	(r306175)
@@ -583,11 +583,13 @@ ffs_cmount(struct mntarg *ma, void *data
  *	2) re-read superblock from disk.
  *	3) re-read summary information from disk.
  *	4) invalidate all inactive vnodes.
- *	5) invalidate all cached file data.
- *	6) re-read inode data for all active vnodes.
+ *	5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary
+ *	   writers, if requested.
+ *	6) invalidate all cached file data.
+ *	7) re-read inode data for all active vnodes.
  */
 int
-ffs_reload(struct mount *mp, struct thread *td, int force)
+ffs_reload(struct mount *mp, struct thread *td, int flags)
 {
 	struct vnode *vp, *mvp, *devvp;
 	struct inode *ip;
@@ -602,7 +604,7 @@ ffs_reload(struct mount *mp, struct thre
 	ump = VFSTOUFS(mp);
 
 	MNT_ILOCK(mp);
-	if ((mp->mnt_flag & MNT_RDONLY) == 0 && force == 0) {
+	if ((mp->mnt_flag & MNT_RDONLY) == 0 && (flags & FFSR_FORCE) == 0) {
 		MNT_IUNLOCK(mp);
 		return (EINVAL);
 	}
@@ -692,6 +694,12 @@ ffs_reload(struct mount *mp, struct thre
 	size = fs->fs_ncg * sizeof(u_int8_t);
 	fs->fs_contigdirs = (u_int8_t *)space;
 	bzero(fs->fs_contigdirs, size);
+	if ((flags & FFSR_UNSUSPEND) != 0) {
+		MNT_ILOCK(mp);
+		mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2);
+		wakeup(&mp->mnt_flag);
+		MNT_IUNLOCK(mp);
+	}
 
 loop:
 	MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609221042.u8MAge6p054030>