[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix data bug in device-mapping invalidation



Currently pagebuf_lock_disable() calls destroy_buffers() and 
truncate_inode_pages() unconditionally.  For the post 2.4.13 case
where the pagebuf modules sits ontop of the blockdevice mapping
this could cause incore data corruption for other openers of that
device (xfsdump?).  The fix is to completly remove the calls,
blkdev_put does them when the last opener finished.

Keep the code for the pre 2.4.13 case as those use their own mapping.
Patch is ontop of my last patch, but the bug is present even without it.

--- linux/fs/xfs/pagebuf/page_buf_locking.c.~hch~	Sat May  4 13:46:55 2002
+++ linux/fs/xfs/pagebuf/page_buf_locking.c	Sat May  4 13:48:33 2002
@@ -324,8 +324,10 @@
 pagebuf_lock_disable(			/* disable buffer locking	*/
 		     pb_target_t *target)  /* inode for buffers	        */
 {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,13))
 	destroy_buffers(target->pbr_device);
 	truncate_inode_pages(PBT_ADDR_SPACE(target), 0LL);
+#endif
 	bdput(target->pbr_bdev);
 	kmem_cache_free(pagebuf_target_cache, target);