public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] syscalls/keyctl02: Fix insufficiency of default key count quota
Date: Wed, 29 Mar 2017 15:21:20 +0800	[thread overview]
Message-ID: <58DB6070.4080607@cn.fujitsu.com> (raw)
In-Reply-To: <1490771549-29656-1-git-send-email-fenggw-fnst@cn.fujitsu.com>

Hi!

Please ignore this one, I will send a V3, sorry.


Best Regards,
Guangwen Feng

On 03/29/2017 03:12 PM, Guangwen Feng wrote:
> Adding and revoking keys rapidly in loops will take a significant
> number of key count quota, because it takes time to free the
> instantiated keys, so temporarily raise the quota when testing.
> 
> Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> ---
>  testcases/kernel/syscalls/keyctl/keyctl02.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/keyctl/keyctl02.c b/testcases/kernel/syscalls/keyctl/keyctl02.c
> index 11d3af9..1fdea79 100644
> --- a/testcases/kernel/syscalls/keyctl/keyctl02.c
> +++ b/testcases/kernel/syscalls/keyctl/keyctl02.c
> @@ -48,6 +48,9 @@
>  #ifdef HAVE_KEYUTILS_H
>  
>  #define LOOPS	20000
> +#define PATH_KEY_COUNT_QUOTA	"/proc/sys/kernel/keys/root_maxkeys"
> +
> +static int orig_maxkeys;
>  
>  static void *do_read(void *arg)
>  {
> @@ -98,9 +101,22 @@ static void do_test(void)
>  	tst_res(TPASS, "Bug not reproduced");
>  }
>  
> +static void setup(void)
> +{
> +	SAFE_FILE_SCANF(PATH_KEY_COUNT_QUOTA, "%d", &orig_maxkeys);
> +	SAFE_FILE_PRINTF(PATH_KEY_COUNT_QUOTA, "%d", orig_maxkeys + LOOPS);
> +}
> +
> +static void cleanup(void)
> +{
> +	SAFE_FILE_PRINTF(PATH_KEY_COUNT_QUOTA, "%d", orig_maxkeys);
> +}
> +
>  static struct tst_test test = {
>  	.tid = "keyctl02",
>  	.needs_root = 1,
> +	.setup = setup,
> +	.cleanup = cleanup,
>  	.test_all = do_test,
>  };
>  
> 



  reply	other threads:[~2017-03-29  7:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 10:22 [LTP] [PATCH] syscalls/keyctl02: Fix insufficiency of default key count quota Guangwen Feng
2017-03-29  7:12 ` [LTP] [PATCH v2] " Guangwen Feng
2017-03-29  7:21   ` Guangwen Feng [this message]
2017-03-29  7:23     ` [LTP] [PATCH v3] " Guangwen Feng
2017-03-30 14:30       ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58DB6070.4080607@cn.fujitsu.com \
    --to=fenggw-fnst@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox