diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-01-13 12:08:11 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-01-13 12:08:11 -0500 |
commit | d8c951c313ed1d7144b55c0d56f7c53220044dda (patch) | |
tree | 51d2a904da45349403b0db80fb9f8812967ec5dd /fs/nfs/pnfs.h | |
parent | 16a6ddc70920a0686dbf90e092a539c1a4fd7b77 (diff) |
NFSv4.1: Don't trust attributes if a pNFS LAYOUTCOMMIT is outstanding
If a LAYOUTCOMMIT is outstanding, then chances are that the metadata
server may still be returning incorrect values for the change attribute,
ctime, mtime and/or size.
Just ignore those attributes for now, and wait for the LAYOUTCOMMIT
rpc call to finish.
Reported-by: shaobingqing <shaobingqing@bwstor.com.cn>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pnfs.h')
-rw-r--r-- | fs/nfs/pnfs.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index a4f41810a7f4..023793909778 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -359,6 +359,15 @@ pnfs_ld_layoutret_on_setattr(struct inode *inode) | |||
359 | PNFS_LAYOUTRET_ON_SETATTR; | 359 | PNFS_LAYOUTRET_ON_SETATTR; |
360 | } | 360 | } |
361 | 361 | ||
362 | static inline bool | ||
363 | pnfs_layoutcommit_outstanding(struct inode *inode) | ||
364 | { | ||
365 | struct nfs_inode *nfsi = NFS_I(inode); | ||
366 | |||
367 | return test_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->flags) != 0 || | ||
368 | test_bit(NFS_INO_LAYOUTCOMMITTING, &nfsi->flags) != 0; | ||
369 | } | ||
370 | |||
362 | static inline int pnfs_return_layout(struct inode *ino) | 371 | static inline int pnfs_return_layout(struct inode *ino) |
363 | { | 372 | { |
364 | struct nfs_inode *nfsi = NFS_I(ino); | 373 | struct nfs_inode *nfsi = NFS_I(ino); |
@@ -515,6 +524,13 @@ pnfs_use_threshold(struct nfs4_threshold **dst, struct nfs4_threshold *src, | |||
515 | return false; | 524 | return false; |
516 | } | 525 | } |
517 | 526 | ||
527 | static inline bool | ||
528 | pnfs_layoutcommit_outstanding(struct inode *inode) | ||
529 | { | ||
530 | return false; | ||
531 | } | ||
532 | |||
533 | |||
518 | static inline struct nfs4_threshold *pnfs_mdsthreshold_alloc(void) | 534 | static inline struct nfs4_threshold *pnfs_mdsthreshold_alloc(void) |
519 | { | 535 | { |
520 | return NULL; | 536 | return NULL; |