From 4877fa61ee44e981753afa66206de980ccd811ec Mon Sep 17 00:00:00 2001 From: tegge Date: Mon, 2 Oct 2006 02:08:31 +0000 Subject: [PATCH] Correct check for when IO_SYNC should be set for filesystem not using softupdates when truncating a directory to zero length. Discussed with: bde --- sys/ufs/ufs/ufs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 2993443e48db..768860a7570a 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1214,7 +1214,7 @@ ufs_rename(ap) DIP_SET(xp, i_nlink, xp->i_nlink); xp->i_flag |= IN_CHANGE; ioflag = IO_NORMAL; - if (DOINGASYNC(tvp)) + if (!DOINGASYNC(tvp)) ioflag |= IO_SYNC; if ((error = UFS_TRUNCATE(tvp, (off_t)0, ioflag, tcnp->cn_cred, tcnp->cn_thread)) != 0) @@ -1721,7 +1721,7 @@ ufs_rmdir(ap) DIP_SET(ip, i_nlink, ip->i_nlink); ip->i_flag |= IN_CHANGE; ioflag = IO_NORMAL; - if (DOINGASYNC(vp)) + if (!DOINGASYNC(vp)) ioflag |= IO_SYNC; error = UFS_TRUNCATE(vp, (off_t)0, ioflag, cnp->cn_cred, cnp->cn_thread);