

Quick hack to plug a use-after-free bug which triggers with
CONFIG_DEBUG_PAGEALLOC.



 fs/xfs/xfs_buf.h |    2 ++
 1 files changed, 2 insertions(+)

diff -puN fs/xfs/xfs_buf.h~xfs-use-after-free-fix fs/xfs/xfs_buf.h
--- 25/fs/xfs/xfs_buf.h~xfs-use-after-free-fix	2003-08-02 01:03:33.000000000 -0700
+++ 25-akpm/fs/xfs/xfs_buf.h	2003-08-02 01:03:33.000000000 -0700
@@ -220,8 +220,10 @@ static inline int	xfs_bawrite(void *mp, 
 	bp->pb_fspriv3 = mp;
 	bp->pb_strat = xfs_bdstrat_cb;
 	xfs_buf_undelay(bp);
+	atomic_inc(&bp->pb_hold);
 	if ((ret = pagebuf_iostart(bp, PBF_WRITE | PBF_ASYNC)) == 0)
 		pagebuf_run_queues(bp);
+	pagebuf_rele(bp);
 	return ret;
 }
 

_
