summaryrefslogtreecommitdiff
path: root/fs/nfs/blocklayout/blocklayout.h
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2012-08-23 16:27:51 (GMT)
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-01 22:38:24 (GMT)
commitfe6e1e8d9fad86873eb74a26e80a8f91f9e870b5 (patch)
treed09ce2464d48894ec12d39571d79e1176b493cfb /fs/nfs/blocklayout/blocklayout.h
parent5d0e3a004f02bffab51f542fa1d5b2e2854d8545 (diff)
downloadlinux-fe6e1e8d9fad86873eb74a26e80a8f91f9e870b5.tar.xz
pnfsblock: fix partial page buffer wirte
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. Cc: stable <stable@vger.kernel.org> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayout.h')
-rw-r--r--fs/nfs/blocklayout/blocklayout.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h
index 0335069..39bb51a 100644
--- a/fs/nfs/blocklayout/blocklayout.h
+++ b/fs/nfs/blocklayout/blocklayout.h
@@ -41,6 +41,7 @@
#define PAGE_CACHE_SECTORS (PAGE_CACHE_SIZE >> SECTOR_SHIFT)
#define PAGE_CACHE_SECTOR_SHIFT (PAGE_CACHE_SHIFT - SECTOR_SHIFT)
+#define SECTOR_SIZE (1 << SECTOR_SHIFT)
struct block_mount_id {
spinlock_t bm_lock; /* protects list */