diff options
author | Niu Yawei <yawei.niu@gmail.com> | 2014-06-04 00:22:13 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-07-15 16:36:18 -0400 |
commit | d68aab6b8f572406aa93b45ef6483934dd3b54a6 (patch) | |
tree | e21ddba36d8ffa6706dc0c0db4ff7f8a81a92f2e /fs | |
parent | 1795cd9b3a91d4b5473c97f491d63892442212ab (diff) |
quota: missing lock in dqcache_shrink_scan()
Commit 1ab6c4997e04 (fs: convert fs shrinkers to new scan/count API)
accidentally removed locking from quota shrinker. Fix it -
dqcache_shrink_scan() should use dq_list_lock to protect the
scan on free_dquots list.
CC: stable@vger.kernel.org
Fixes: 1ab6c4997e04a00c50c6d786c2f046adc0d1f5de
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/quota/dquot.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 9cd5f63715c0..7f30bdc57d13 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -702,6 +702,7 @@ dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) | |||
702 | struct dquot *dquot; | 702 | struct dquot *dquot; |
703 | unsigned long freed = 0; | 703 | unsigned long freed = 0; |
704 | 704 | ||
705 | spin_lock(&dq_list_lock); | ||
705 | head = free_dquots.prev; | 706 | head = free_dquots.prev; |
706 | while (head != &free_dquots && sc->nr_to_scan) { | 707 | while (head != &free_dquots && sc->nr_to_scan) { |
707 | dquot = list_entry(head, struct dquot, dq_free); | 708 | dquot = list_entry(head, struct dquot, dq_free); |
@@ -713,6 +714,7 @@ dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) | |||
713 | freed++; | 714 | freed++; |
714 | head = free_dquots.prev; | 715 | head = free_dquots.prev; |
715 | } | 716 | } |
717 | spin_unlock(&dq_list_lock); | ||
716 | return freed; | 718 | return freed; |
717 | } | 719 | } |
718 | 720 | ||