Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2012 10:11:17 +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-8@freebsd.org
Subject:   svn commit: r231965 - stable/8/sys/ufs/ufs
Message-ID:  <201202211011.q1LABHTA093393@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Feb 21 10:11:17 2012
New Revision: 231965
URL: http://svn.freebsd.org/changeset/base/231965

Log:
  MFC r231122:
  Sprinkle missed calls to asynchronous UFS_UPDATE() in attempt to
  guarantee that all UFS inode metadata changes results in the dirtiness
  of the inodeblock.
  
  Approved by:	re (bz)

Modified:
  stable/8/sys/ufs/ufs/ufs_acl.c
  stable/8/sys/ufs/ufs/ufs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/ufs/ufs/ufs_acl.c
==============================================================================
--- stable/8/sys/ufs/ufs/ufs_acl.c	Tue Feb 21 09:12:35 2012	(r231964)
+++ stable/8/sys/ufs/ufs/ufs_acl.c	Tue Feb 21 10:11:17 2012	(r231965)
@@ -420,7 +420,8 @@ ufs_setacl_nfs4_internal(struct vnode *v
 
 	VN_KNOTE_UNLOCKED(vp, NOTE_ATTRIB);
 
-	return (0);
+	error = UFS_UPDATE(vp, 0);
+	return (error);
 }
 
 static int
@@ -589,10 +590,11 @@ ufs_setacl_posix1e(struct vop_setacl_arg
 		 */
 		ufs_sync_inode_from_acl(ap->a_aclp, ip);
 		ip->i_flag |= IN_CHANGE;
+		error = UFS_UPDATE(ap->a_vp, 0);
 	}
 
 	VN_KNOTE_UNLOCKED(ap->a_vp, NOTE_ATTRIB);
-	return (0);
+	return (error);
 }
 
 int

Modified: stable/8/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- stable/8/sys/ufs/ufs/ufs_vnops.c	Tue Feb 21 09:12:35 2012	(r231964)
+++ stable/8/sys/ufs/ufs/ufs_vnops.c	Tue Feb 21 10:11:17 2012	(r231965)
@@ -562,8 +562,9 @@ ufs_setattr(ap)
 			DIP_SET(ip, i_flags, ip->i_flags);
 		}
 		ip->i_flag |= IN_CHANGE;
+		error = UFS_UPDATE(vp, 0);
 		if (vap->va_flags & (IMMUTABLE | APPEND))
-			return (0);
+			return (error);
 	}
 	if (ip->i_flags & (IMMUTABLE | APPEND))
 		return (EPERM);
@@ -729,6 +730,9 @@ ufs_markatime(ap)
 	VI_LOCK(vp);
 	ip->i_flag |= IN_ACCESS;
 	VI_UNLOCK(vp);
+	/*
+	 * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there.
+	 */
 	return (0);
 }
 
@@ -785,6 +789,9 @@ ufs_chmod(vp, mode, cred, td)
 	if ((vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0)
 		error = ufs_update_nfs4_acl_after_mode_change(vp, mode, ip->i_uid, cred, td);
 #endif
+	if (error == 0 && (ip->i_flag & IN_CHANGE) != 0)
+		error = UFS_UPDATE(vp, 0);
+
 	return (error);
 }
 
@@ -903,7 +910,8 @@ good:
 			DIP_SET(ip, i_mode, ip->i_mode);
 		}
 	}
-	return (0);
+	error = UFS_UPDATE(vp, 0);
+	return (error);
 }
 
 static int
@@ -2071,6 +2079,7 @@ ufs_rmdir(ap)
 		dp->i_nlink--;
 		DIP_SET(dp, i_nlink, dp->i_nlink);
 		dp->i_flag |= IN_CHANGE;
+		error = UFS_UPDATE(dvp, 0);
 		ip->i_nlink--;
 		DIP_SET(ip, i_nlink, ip->i_nlink);
 		ip->i_flag |= IN_CHANGE;
@@ -2119,6 +2128,7 @@ ufs_symlink(ap)
 		ip->i_size = len;
 		DIP_SET(ip, i_size, len);
 		ip->i_flag |= IN_CHANGE | IN_UPDATE;
+		error = UFS_UPDATE(vp, 0);
 	} else
 		error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0,
 		    UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK,



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