| To: | darrick.wong@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH 3/3] xfs: cancel COW in xfs_cancel_ioend |
| From: | Christoph Hellwig <hch@xxxxxx> |
| Date: | Sun, 3 Jan 2016 13:07:53 +0100 |
| Cc: | david@xxxxxxxxxxxxx, xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1451822873-12969-1-git-send-email-hch@xxxxxx> |
| References: | <1451822873-12969-1-git-send-email-hch@xxxxxx> |
Otherwise we leak COW allocations done earlier in writepage. This
can be reproduced fairly easily when we hit the non-blocking writeback
EAGAIN case.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
fs/xfs/xfs_aops.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 185415a..9c69dc3 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -588,6 +588,7 @@ xfs_cancel_ioend(
{
xfs_ioend_t *next;
struct buffer_head *bh, *next_bh;
+ int error;
do {
next = ioend->io_list;
@@ -605,6 +606,12 @@ xfs_cancel_ioend(
unlock_buffer(bh);
} while ((bh = next_bh) != NULL);
+ if (ioend->io_flags & XFS_IOEND_COW) {
+ error = xfs_reflink_end_cow_failed(
+ XFS_I(ioend->io_inode),
+ ioend->io_offset, ioend->io_size);
+ WARN_ON_ONCE(error);
+ }
mempool_free(ioend, xfs_ioend_pool);
} while ((ioend = next) != NULL);
}
--
1.9.1
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2/3] xfs: only end a COW operation in xfs_zero_remaining_bytes if we started one, Christoph Hellwig |
|---|---|
| Next by Date: | Re: [PATCH 02/76] xfs: fix log ticket type printing, Christoph Hellwig |
| Previous by Thread: | Re: [PATCH 2/3] xfs: only end a COW operation in xfs_zero_remaining_bytes if we started one, Darrick J. Wong |
| Next by Thread: | Re: [PATCH 3/3] xfs: cancel COW in xfs_cancel_ioend, Darrick J. Wong |
| Indexes: | [Date] [Thread] [Top] [All Lists] |