Skip to content

Commit 170fc78

Browse files
author
Theodore Ts'o
committed
ext4 crypto: fix return value for ext4_es_scan()
Between 3.10 and 3.18, the abstraction to scan for objects in the slab cache which can be freed when the system is under memory pressure changed. When I backported the ext4 code from 3.18 to the 3.10 kernel, I didn't get the return value required by the calling conventions for the scan function correct, which could potentially cause the memory reclaimer to loop indefinitely. Change-Id: I1712fedf96fd91c911fb4d019d7ef76f6c4c1808 Signed-off-by: "Theodore Ts'o" <[email protected]>
1 parent 7daac21 commit 170fc78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/extents_status.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ static unsigned long ext4_es_scan(struct shrinker *shrink,
10771077
nr_shrunk = __ext4_es_shrink(sbi, nr_to_scan, NULL);
10781078

10791079
trace_ext4_es_shrink_scan_exit(sbi->s_sb, nr_shrunk, ret);
1080-
return nr_shrunk;
1080+
return percpu_counter_read_positive(&sbi->s_es_stats.es_stats_lru_cnt);
10811081
}
10821082

10831083
static int ext4_es_shrink(struct shrinker *shrink, struct shrink_control *sc)

0 commit comments

Comments
 (0)