Skip to contentSkip to conversation

Review - flush blockdev on close

DISCUSSION David Chinner 2 participants 2 messages Apr 24, 2007

lore
Share & tools
lore
#0 lore raw

As suggested by Christoph, we probably should flush the block device as we complete the process of unmounting the filesystem. Patch attached.

Cheers,

Dave.

Signature · 20 lines
Dave Chinner
Principal Engineer
SGI Australian Software Group

---
 fs/xfs/linux-2.6/xfs_buf.c |    1 +
 1 file changed, 1 insertion(+)

Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c	2007-04-24 09:32:22.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c	2007-04-24 11:12:42.181361346 +1000
@@ -1464,6 +1464,7 @@ xfs_free_buftarg(
 	int			external)
 {
 	xfs_flush_buftarg(btp, 1);
+	xfs_blkdev_issue_flush(btp);
 	if (external)
 		xfs_blkdev_put(btp->bt_bdev);
 	xfs_free_bufhash(btp);
#1 lore raw
Quoted 4 lines · David Chinner

As suggested by Christoph, we probably should flush the block device as we complete the process of unmounting the filesystem. Patch attached.

Looks good.

Quoted 13 lines

Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c
===================================================================

fs/xfs/linux-2.6/xfs_buf.c +1 -0
@@ -1464,6 +1464,7 @@ xfs_free_buftarg(
 	int			external)
 {
 	xfs_flush_buftarg(btp, 1);
+	xfs_blkdev_issue_flush(btp);
 	if (external)
 		xfs_blkdev_put(btp->bt_bdev);
 	xfs_free_bufhash(btp);