patch-2.4.23 linux-2.4.23/fs/jfs/inode.c

Next file: linux-2.4.23/fs/jfs/jfs_btree.h
Previous file: linux-2.4.23/fs/jfs/file.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/fs/jfs/inode.c linux-2.4.23/fs/jfs/inode.c
@@ -149,19 +149,23 @@
 	rc = txCommit(tid, 1, &inode, wait ? COMMIT_SYNC : 0);
 	txEnd(tid);
 	up(&JFS_IP(inode)->commit_sem);
-	return -rc;
+	return rc;
 }
 
 void jfs_write_inode(struct inode *inode, int wait)
 {
+	if (test_cflag(COMMIT_Nolink, inode))
+		return;
 	/*
 	 * If COMMIT_DIRTY is not set, the inode isn't really dirty.
 	 * It has been committed since the last change, but was still
-	 * on the dirty inode list
+	 * on the dirty inode list.
 	 */
-	if (test_cflag(COMMIT_Nolink, inode) ||
-	    !test_cflag(COMMIT_Dirty, inode))
+	 if (!test_cflag(COMMIT_Dirty, inode)) {
+		/* Make sure committed changes hit the disk */
+		jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
 		return;
+	 }
 
 	if (jfs_commit_inode(inode, wait)) {
 		jfs_err("jfs_write_inode: jfs_commit_inode failed!");
@@ -303,7 +307,7 @@
 		else
 			IREAD_UNLOCK(ip);
 	}
-	return -rc;
+	return rc;
 }
 
 static int jfs_writepage(struct page *page)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)