pnfsblock: fix partial page buffer wirte
authorPeng Tao <bergwolf@gmail.com>
Thu, 23 Aug 2012 16:27:51 +0000 (00:27 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 17 Oct 2012 02:49:21 +0000 (03:49 +0100)
commit9392e7db7bc62b61ec72c8aa020f4d7e07118bff
treecac3c674e284afb63cf3a4c4ba3cae007e7d5f1e
parent5ff39e971c87ea9f4c4c7b253898abafa960e32b
pnfsblock: fix partial page buffer wirte

commit fe6e1e8d9fad86873eb74a26e80a8f91f9e870b5 upstream.

If applications use flock to protect its write range, generic NFS
will not do read-modify-write cycle at page cache level. Therefore
LD should know how to handle non-sector aligned writes. Otherwise
there will be data corruption.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[bwh: Backported to Linux 3.2:
 - Adjust context
 - s/wdata->pages\.npages/wdata->npages/
 - s/header->pnfs_error/wdata->pnfs_error/
 - Drop change in missing out_mds exit path]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/blocklayout/blocklayout.c
fs/nfs/blocklayout/blocklayout.h