]> git.baikalelectronics.ru Git - kernel.git/commit
pnfs/blocklayout: update last_write_offset atomically with extents
authorBenjamin Coddington <bcodding@redhat.com>
Mon, 22 Aug 2016 18:11:16 +0000 (14:11 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 23 Aug 2016 15:41:38 +0000 (11:41 -0400)
commit863ed2bd09fb0ba14b3a88943a60cac270b8ab18
treea561ace1f94987e1a66cf15d2f218b386bdd8487
parente1d1a2dec8aa099bbd8f1fb6695977a18317cd8e
pnfs/blocklayout: update last_write_offset atomically with extents

Block/SCSI layout write completion may add committable extents to the
extent tree before updating the layout's last-written byte under the inode
lock.  If a sync happens before this value is updated, then
prepare_layoutcommit may find and encode these extents which would produce
a LAYOUTCOMMIT request whose encoded extents are larger than the request's
loca_length.

Fix this by using a last-written byte value that is updated atomically with
the extent tree so that commitable extents always match.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/blocklayout/blocklayout.c
fs/nfs/blocklayout/blocklayout.h
fs/nfs/blocklayout/extent_tree.c