diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-13 12:51:06 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:35 -0400 |
commit | 61d5eb2985b3b1d69fd53d7dc9789037c27f8d91 (patch) | |
tree | 6e73d0e7adcda510ec47d0cd50c57d4461e7fbdf /fs/nfs/dir.c | |
parent | 20673406534176ead9b984a84b662928110f77b1 (diff) |
NFS: Don't run nfs_access_cache_shrinker() when the mask is GFP_NOFS
Both iput() and put_rpccred() might allocate memory under certain
circumstances, so make sure that we don't recurse and deadlock...
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 18da8abbece8..58b1f744c91e 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1703,6 +1703,8 @@ int nfs_access_cache_shrinker(int nr_to_scan, gfp_t gfp_mask) | |||
1703 | struct nfs_inode *nfsi; | 1703 | struct nfs_inode *nfsi; |
1704 | struct nfs_access_entry *cache; | 1704 | struct nfs_access_entry *cache; |
1705 | 1705 | ||
1706 | if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) | ||
1707 | return (nr_to_scan == 0) ? 0 : -1; | ||
1706 | restart: | 1708 | restart: |
1707 | spin_lock(&nfs_access_lru_lock); | 1709 | spin_lock(&nfs_access_lru_lock); |
1708 | list_for_each_entry(nfsi, &nfs_access_lru_list, access_cache_inode_lru) { | 1710 | list_for_each_entry(nfsi, &nfs_access_lru_list, access_cache_inode_lru) { |