summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-02-07 09:51:41 +0000
committerkib <kib@FreeBSD.org>2012-02-07 09:51:41 +0000
commit4880454245aabf4bec7e20cfb1b532d93af38e01 (patch)
tree751574d0fc9da2c9e3cbe8d9a9703d4f6e8e1d1a /sys/ufs
parentc8229e85eb84646131744ce846be3042ff66393a (diff)
downloadFreeBSD-src-4880454245aabf4bec7e20cfb1b532d93af38e01.zip
FreeBSD-src-4880454245aabf4bec7e20cfb1b532d93af38e01.tar.gz
Sprinkle missed calls to asynchronous UFS_UPDATE() in attempt to
guarantee that all UFS inode metadata changes results in the dirtiness of the inodeblock. Due to missed inodeblock updates, syncer was required to fsync each mount point' vnode to guarantee periodic metadata flush. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_acl.c6
-rw-r--r--sys/ufs/ufs/ufs_vnops.c14
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/ufs/ufs/ufs_acl.c b/sys/ufs/ufs/ufs_acl.c
index 1179451..76a4186 100644
--- a/sys/ufs/ufs/ufs_acl.c
+++ b/sys/ufs/ufs/ufs_acl.c
@@ -422,7 +422,8 @@ ufs_setacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td)
VN_KNOTE_UNLOCKED(vp, NOTE_ATTRIB);
- return (0);
+ error = UFS_UPDATE(vp, 0);
+ return (error);
}
static int
@@ -591,10 +592,11 @@ ufs_setacl_posix1e(struct vop_setacl_args *ap)
*/
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
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 171ef75..ab33ef3 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -571,8 +571,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);
@@ -738,6 +739,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);
}
@@ -794,6 +798,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);
}
@@ -912,7 +919,8 @@ good:
DIP_SET(ip, i_mode, ip->i_mode);
}
}
- return (0);
+ error = UFS_UPDATE(vp, 0);
+ return (error);
}
static int
@@ -2079,6 +2087,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;
@@ -2122,6 +2131,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,
OpenPOWER on IntegriCloud