diff options
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index e35c8199f82f..672368f865ca 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1892,8 +1892,14 @@ static int nfs_do_access(struct inode *inode, struct rpc_cred *cred, int mask) | |||
1892 | cache.cred = cred; | 1892 | cache.cred = cred; |
1893 | cache.jiffies = jiffies; | 1893 | cache.jiffies = jiffies; |
1894 | status = NFS_PROTO(inode)->access(inode, &cache); | 1894 | status = NFS_PROTO(inode)->access(inode, &cache); |
1895 | if (status != 0) | 1895 | if (status != 0) { |
1896 | if (status == -ESTALE) { | ||
1897 | nfs_zap_caches(inode); | ||
1898 | if (!S_ISDIR(inode->i_mode)) | ||
1899 | set_bit(NFS_INO_STALE, &NFS_I(inode)->flags); | ||
1900 | } | ||
1896 | return status; | 1901 | return status; |
1902 | } | ||
1897 | nfs_access_add_cache(inode, &cache); | 1903 | nfs_access_add_cache(inode, &cache); |
1898 | out: | 1904 | out: |
1899 | if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0) | 1905 | if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0) |