Skip to content

Commit

Permalink
Add forgotten patch files.
Browse files Browse the repository at this point in the history
  • Loading branch information
smos committed Jun 20, 2012
1 parent f83d697 commit d07c857
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
47 changes: 47 additions & 0 deletions patches/RELENG_8_3/ffs_vfsops.c.diff
@@ -0,0 +1,47 @@
--- stable/8/sys/ufs/ffs/ffs_vfsops.c 2012/01/30 05:45:11 230762
+++ stable/8/sys/ufs/ffs/ffs_vfsops.c 2012/02/21 10:16:17 231967
@@ -1321,17 +1321,26 @@
int softdep_accdeps;
struct bufobj *bo;

+ wait = 0;
+ suspend = 0;
+ suspended = 0;
td = curthread;
fs = ump->um_fs;
if (fs->fs_fmod != 0 && fs->fs_ronly != 0)
panic("%s: ffs_sync: modification on read-only filesystem",
fs->fs_fsmnt);
/*
+ * For a lazy sync, we just care about the filesystem metadata.
+ */
+ if (waitfor == MNT_LAZY) {
+ secondary_accwrites = 0;
+ secondary_writes = 0;
+ lockreq = 0;
+ goto metasync;
+ }
+ /*
* Write back each (modified) inode.
*/
- wait = 0;
- suspend = 0;
- suspended = 0;
lockreq = LK_EXCLUSIVE | LK_NOWAIT;
if (waitfor == MNT_SUSPEND) {
suspend = 1;
@@ -1402,11 +1411,12 @@
#ifdef QUOTA
qsync(mp);
#endif
+
+metasync:
devvp = ump->um_devvp;
bo = &devvp->v_bufobj;
BO_LOCK(bo);
- if (waitfor != MNT_LAZY &&
- (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)) {
+ if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) {
BO_UNLOCK(bo);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
if ((error = VOP_FSYNC(devvp, waitfor, td)) != 0)
59 changes: 59 additions & 0 deletions patches/RELENG_8_3/ufs_vnops.c.diff
@@ -0,0 +1,59 @@
--- stable/8/sys/ufs/ufs/ufs_vnops.c 2011/11/07 23:09:18 227325
+++ stable/8/sys/ufs/ufs/ufs_vnops.c 2012/02/21 10:11:17 231965
@@ -562,8 +562,9 @@
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 @@
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 @@
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 @@
DIP_SET(ip, i_mode, ip->i_mode);
}
}
- return (0);
+ error = UFS_UPDATE(vp, 0);
+ return (error);
}

static int
@@ -2071,6 +2079,7 @@
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 @@
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,

0 comments on commit d07c857

Please sign in to comment.