linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value
@ 2013-10-21 16:58 John Stultz
  2013-10-22 20:48 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: John Stultz @ 2013-10-21 16:58 UTC (permalink / raw)
  To: LKML
  Cc: John Stultz, Greg KH, Colin Cross, Android Kernel Team,
	Dave Chinner, Glauber Costa

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 <gregkh@linuxfoundation.org>
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: Glauber Costa <glommer@openvz.org>
Reported-by: YongQin Liu <yongqin.liu@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 drivers/staging/android/ashmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 8e76ddc..5a5e9c9 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -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);
 		}
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value
  2013-10-21 16:58 [PATCH] staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value John Stultz
@ 2013-10-22 20:48 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2013-10-22 20:48 UTC (permalink / raw)
  To: John Stultz
  Cc: LKML, Greg KH, Colin Cross, Android Kernel Team, Glauber Costa

On Mon, Oct 21, 2013 at 09:58:07AM -0700, John Stultz wrote:
> 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.

Acked-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
dchinner@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-22 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-21 16:58 [PATCH] staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value John Stultz
2013-10-22 20:48 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).