Skip to contentSkip to conversation

Patch "pnfs/blocklayout: fix last_write_offset incorrectly set to page boundary" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Oct 26, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

pnfs/blocklayout: fix last_write_offset incorrectly set to page boundary

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
pnfs-blocklayout-fix-last_write_offset-incorrectly-set-to-page-boundary.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From a3f9d1b58a9ffce011ef4f074bfa36ae30eade28 Mon Sep 17 00:00:00 2001

From: Benjamin Coddington <[email protected]>
Date: Tue, 11 Oct 2016 15:53:21 -0400
Subject: pnfs/blocklayout: fix last_write_offset incorrectly set to page boundary

From: Benjamin Coddington <[email protected]>

commit a3f9d1b58a9ffce011ef4f074bfa36ae30eade28 upstream.

Commit 41963c10c47a35185e68cb9049f7a3493c94d2d7 sets the block layout's last written byte to the offset of the end of the extent rather than the end of the write which incorrectly updates the inode's size for partial-page writes.

Fixes 41963c10c47a ("pnfs/blocklayout: update last_write_offset atomically with extents")
---
 fs/nfs/blocklayout/blocklayout.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfs/blocklayout/blocklayout.c +2 -1
@@ -344,9 +344,10 @@ static void bl_write_cleanup(struct work
 		u64 start = hdr->args.offset & (loff_t)PAGE_MASK;
 		u64 end = (hdr->args.offset + hdr->args.count +
 			PAGE_SIZE - 1) & (loff_t)PAGE_MASK;
+		u64 lwb = hdr->args.offset + hdr->args.count;
 
 		ext_tree_mark_written(bl, start >> SECTOR_SHIFT,
-					(end - start) >> SECTOR_SHIFT, end);
+					(end - start) >> SECTOR_SHIFT, lwb);
 	}
 
 	pnfs_ld_write_done(hdr);

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/pnfs-blocklayout-fix-last_write_offset-incorrectly-set-to-page-boundary.patch