diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-29 15:11:56 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-09-29 15:16:25 -0400 |
commit | aa510da5bfe1dfe263215fd0e05dac96e738a782 (patch) | |
tree | 23653cea38532e688f593e36295c312158558a79 /fs/nfs | |
parent | a00dd6c03dd97a777c291a8af8682be4b5fadf8d (diff) |
NFS: We must use list_for_each_entry_safe in nfs_access_cache_shrinker
We may end up removing the current entry from nfs_access_lru_list.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 86f1d41c6078..fe549f5ef20f 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1788,14 +1788,14 @@ static void nfs_access_free_list(struct list_head *head) | |||
1788 | int nfs_access_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) | 1788 | int nfs_access_cache_shrinker(struct shrinker *shrink, int nr_to_scan, gfp_t gfp_mask) |
1789 | { | 1789 | { |
1790 | LIST_HEAD(head); | 1790 | LIST_HEAD(head); |
1791 | struct nfs_inode *nfsi; | 1791 | struct nfs_inode *nfsi, *next; |
1792 | struct nfs_access_entry *cache; | 1792 | struct nfs_access_entry *cache; |
1793 | 1793 | ||
1794 | if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) | 1794 | if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) |
1795 | return (nr_to_scan == 0) ? 0 : -1; | 1795 | return (nr_to_scan == 0) ? 0 : -1; |
1796 | 1796 | ||
1797 | spin_lock(&nfs_access_lru_lock); | 1797 | spin_lock(&nfs_access_lru_lock); |
1798 | list_for_each_entry(nfsi, &nfs_access_lru_list, access_cache_inode_lru) { | 1798 | list_for_each_entry_safe(nfsi, next, &nfs_access_lru_list, access_cache_inode_lru) { |
1799 | struct inode *inode; | 1799 | struct inode *inode; |
1800 | 1800 | ||
1801 | if (nr_to_scan-- == 0) | 1801 | if (nr_to_scan-- == 0) |