[PATCH] JFS: Possible trap/data loss when fixing directory index table (1 of 1)

Dave Kleikamp <[email protected]> Thu, 17 Jul 2003 12:40:30 -0500
Newsgroups gmane.comp.file-systems.jfs.patches
Message-ID <[email protected]>
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1003  -> 1.1004 
#	  fs/jfs/jfs_dtree.c	1.11    -> 1.12   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/23	[email protected]	1.1004
# JFS: Possible trap/data loss when fixing directory index table
# --------------------------------------------
#
diff -Nru a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
--- a/fs/jfs/jfs_dtree.c	Thu Jul 17 12:38:33 2003
+++ b/fs/jfs/jfs_dtree.c	Thu Jul 17 12:38:33 2003
@@ -2908,7 +2908,7 @@
 			d->index = cpu_to_le32(add_index(tid, inode, bn, i));
 			if (dtlck->index >= dtlck->maxcnt)
 				dtlck = (struct dt_lock *) txLinelock(dtlck);
-			lv = dtlck->lv;
+			lv = &dtlck->lv[dtlck->index];
 			lv->offset = stbl[i];
 			lv->length = 1;
 			dtlck->index++;