Skip to contentSkip to conversation

staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value

PATCH In review John Stultz 2 participants 2 messages Oct 21, 2013 – Oct 22, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value

Hopefully this isn't too late for 3.12.

In commit 7dc19d5aff (convert shrinkers to new count/scan API) the return value to PURGE_ALL_CACHES was dropped, causing -EPERM to always be returned.

This patch re-adds the ret assignment, setting it to the the ashmem_shrink_count(), which is the lru_count.

(Sorry this was missed in the review!)

Cc Greg KH <[email protected]>
Cc Colin Cross <[email protected]>
Cc Android Kernel Team <[email protected]>
Cc Dave Chinner <[email protected]>
Cc Glauber Costa <[email protected]>
---
 drivers/staging/android/ashmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ashmem.c +1 -1
index 8e76ddc..5a5e9c9 100644
@@ -706,7 +706,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 				.gfp_mask = GFP_KERNEL,
 				.nr_to_scan = LONG_MAX,
 			};
-
+			ret = ashmem_shrink_count(&ashmem_shrinker, &sc);
 			nodes_setall(sc.nodes_to_scan);
 			ashmem_shrink_scan(&ashmem_shrinker, &sc);
 		}
Signature · 1 line
1.8.1.2
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · John Stultz

Hopefully this isn't too late for 3.12.

In commit 7dc19d5aff (convert shrinkers to new count/scan API) the return value to PURGE_ALL_CACHES was dropped, causing -EPERM to always be returned.

This patch re-adds the ret assignment, setting it to the the ashmem_shrink_count(), which is the lru_count.

Looks sane.

Signature · 2 lines
Dave Chinner
[email protected]