Skip to contentSkip to conversation

reiser4: fix disk cluster synchronization

PATCH New Edward Shishkin 1 participant 1 message Jan 6, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 reiser4: fix disk cluster synchronization

Problem:
(2.6.24-rc3-mm2) BUG: unable to handle kernel NULL pointer dereference at virtual address 00000024 EIP is at convert_ctail+0x14e/0x166

Bug: When updating disk clusters convert_ctail() looks at inode which is already evicted from memory or reused for other needs.

Fixup: Keep all needed file-specific info in convert_item_info before disk cluster update (when inode is pinned), then forget about inode.

Cleanups in plugin/file/file_conversion.c

---
 linux-2.6.24-rc6-mm1/fs/reiser4/flush.h                       |    9 --
 linux-2.6.24-rc6-mm1/fs/reiser4/plugin/file/file_conversion.c |   42 ++-------
 linux-2.6.24-rc6-mm1/fs/reiser4/plugin/item/ctail.c           |   44 ++++------
 3 files changed, 35 insertions(+), 60 deletions(-)
fs/reiser4/flush.h renamed from fs/reiser4/flush.h.orig +2 -7
@@ -59,8 +59,8 @@
 struct convert_item_info {
 	dc_item_stat d_cur;	/* disk cluster state of the current item */
 	dc_item_stat d_next;	/* disk cluster state of the next slum item */
-	struct inode *inode;
-	flow_t flow;
+	int cluster_shift;      /* disk cluster shift */
+	flow_t flow;            /* disk cluster data */
 };
 
 struct convert_info {
@@ -242,11 +242,6 @@
 		       item_convert_data(pos)->d_cur,			\
 		       item_convert_data(pos)->d_next,			\
 		       item_convert_data(pos)->flow.length);		\
-		printk("inode %llu, size = %llu, cluster %lu\n",	\
-		       (unsigned long long)get_inode_oid		\
-		       (item_convert_data(pos)->inode),			\
-		       i_size_read(item_convert_data(pos)->inode),	\
-		       convert_data(pos)->clust.index);			\
 	}								\
 } while (0)
 #else
fs/reiser4/plugin/file/file_conversion.c renamed from fs/reiser4/plugin/file/file_conversion.c.orig +12 -30

73 lines not on this page · raw message

fs/reiser4/plugin/item/ctail.c renamed from fs/reiser4/plugin/item/ctail.c.orig +21 -23

113 lines not on this page · raw message