From: NeilBrown Date: Mon, 21 Jun 2010 00:39:00 +0000 (+1000) Subject: Don't let writepage spoil a transaction. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=46b138281062b314cf5a6ca7d4e2416bece7de27;p=LaFS.git Don't let writepage spoil a transaction. If a block is involved in a transaction (e.g. dir update) we mustn't allow writepage to flush the page until the transaction completes. Signed-off-by: NeilBrown --- diff --git a/file.c b/file.c index 6fb1732..69b6a88 100644 --- a/file.c +++ b/file.c @@ -218,8 +218,15 @@ lafs_writepage(struct page *page, struct writeback_control *wbc) rv = AOP_WRITEPAGE_ACTIVATE; else { lafs_iolock_written(&b->b); - /* block might have been invalidated while we waited */ - if (test_bit(B_Dirty, &b->b.flags)) + /* block might have been invalidated, + * or Pinned, while we waited */ + /* FIXME do I need to test if the iblock has appeared + * while we waited too?? + */ + if (test_bit(B_PinPending, &b->b.flags)) { + rv = AOP_WRITEPAGE_ACTIVATE; + lafs_iounlock_block(&b->b); + } else if (test_bit(B_Dirty, &b->b.flags)) lafs_cluster_allocate(&b->b, 0); else lafs_iounlock_block(&b->b);