mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 04:42:13 +00:00
NFS: Add mount option 'softreval'
Add a mount option 'softreval' that allows attribute revalidation 'getattr' calls to time out, and causes them to fall back to using the cached attributes. The use case for this option is for ensuring that we can still (slowly) traverse paths and use cached information even when the server is down. Once the server comes back up again, the getattr calls start succeeding, and the caches will revalidate as usual. The 'softreval' mount option is automatically enabled if you have specified 'softerr'. It can be turned off using the options 'nosoftreval', or 'hard'. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
5c965db86e
commit
c74dfe97c1
7 changed files with 59 additions and 12 deletions
|
@ -1156,7 +1156,13 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
|
|||
dfprintk(PAGECACHE, "nfs_revalidate_inode: (%s/%Lu) getattr failed, error=%d\n",
|
||||
inode->i_sb->s_id,
|
||||
(unsigned long long)NFS_FILEID(inode), status);
|
||||
if (status == -ESTALE) {
|
||||
switch (status) {
|
||||
case -ETIMEDOUT:
|
||||
/* A soft timeout occurred. Use cached information? */
|
||||
if (server->flags & NFS_MOUNT_SOFTREVAL)
|
||||
status = 0;
|
||||
break;
|
||||
case -ESTALE:
|
||||
nfs_zap_caches(inode);
|
||||
if (!S_ISDIR(inode->i_mode))
|
||||
set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue