public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/fanotify03: Cleanup backup file descriptor
@ 2018-09-11 14:56 Amir Goldstein
  2018-09-12  7:01 ` Richard Palethorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Amir Goldstein @ 2018-09-11 14:56 UTC (permalink / raw)
  To: ltp

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Cyril,

As requested by Richard, here is the fanotify03 minor fix separated from
whitespace cleanup.
If you wish to take the whitespace cleanup patch you can find it here:
https://github.com/amir73il/ltp/commits/fanotify_sb

Thanks,
Amir.

 testcases/kernel/syscalls/fanotify/fanotify03.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fanotify/fanotify03.c b/testcases/kernel/syscalls/fanotify/fanotify03.c
index 50401157b..966366a72 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify03.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify03.c
@@ -57,6 +57,7 @@
 static char fname[BUF_SIZE];
 static char buf[BUF_SIZE];
 static volatile int fd_notify;
+static int fd_notify_backup = -1;
 
 static pid_t child_pid;
 
@@ -140,7 +141,7 @@ static void check_child(void)
 
 void test01(void)
 {
-	int tst_count, fd_notify_backup = -1;
+	int tst_count;
 
 	int ret, len = 0, i = 0, test_num = 0;
 
@@ -262,6 +263,8 @@ static void cleanup(void)
 {
 	if (fd_notify > 0)
 		SAFE_CLOSE(fd_notify);
+	if (fd_notify_backup > 0)
+		SAFE_CLOSE(fd_notify_backup);
 }
 
 static struct tst_test test = {
-- 
2.17.1


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

* [LTP] [PATCH] syscalls/fanotify03: Cleanup backup file descriptor
  2018-09-11 14:56 [LTP] [PATCH] syscalls/fanotify03: Cleanup backup file descriptor Amir Goldstein
@ 2018-09-12  7:01 ` Richard Palethorpe
  2018-09-28  7:39   ` Amir Goldstein
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Palethorpe @ 2018-09-12  7:01 UTC (permalink / raw)
  To: ltp

Hello,

Amir Goldstein <amir73il@gmail.com> writes:

> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>
> Cyril,
>
> As requested by Richard, here is the fanotify03 minor fix separated from
> whitespace cleanup.
> If you wish to take the whitespace cleanup patch you can find it here:
> https://github.com/amir73il/ltp/commits/fanotify_sb

LGTM

>
> Thanks,
> Amir.
>
>  testcases/kernel/syscalls/fanotify/fanotify03.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/fanotify/fanotify03.c b/testcases/kernel/syscalls/fanotify/fanotify03.c
> index 50401157b..966366a72 100644
> --- a/testcases/kernel/syscalls/fanotify/fanotify03.c
> +++ b/testcases/kernel/syscalls/fanotify/fanotify03.c
> @@ -57,6 +57,7 @@
>  static char fname[BUF_SIZE];
>  static char buf[BUF_SIZE];
>  static volatile int fd_notify;
> +static int fd_notify_backup = -1;
>  
>  static pid_t child_pid;
>  
> @@ -140,7 +141,7 @@ static void check_child(void)
>  
>  void test01(void)
>  {
> -	int tst_count, fd_notify_backup = -1;
> +	int tst_count;
>  
>  	int ret, len = 0, i = 0, test_num = 0;
>  
> @@ -262,6 +263,8 @@ static void cleanup(void)
>  {
>  	if (fd_notify > 0)
>  		SAFE_CLOSE(fd_notify);
> +	if (fd_notify_backup > 0)
> +		SAFE_CLOSE(fd_notify_backup);
>  }
>  
>  static struct tst_test test = {


-- 
Thank you,
Richard.

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

* [LTP] [PATCH] syscalls/fanotify03: Cleanup backup file descriptor
  2018-09-12  7:01 ` Richard Palethorpe
@ 2018-09-28  7:39   ` Amir Goldstein
  0 siblings, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2018-09-28  7:39 UTC (permalink / raw)
  To: ltp

On Wed, Sep 12, 2018 at 10:01 AM Richard Palethorpe <rpalethorpe@suse.de> wrote:
>
> Hello,
>
> Amir Goldstein <amir73il@gmail.com> writes:
>
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> >
> > Cyril,
> >
> > As requested by Richard, here is the fanotify03 minor fix separated from
> > whitespace cleanup.

FYI, I submitted a github pull request for the cleanup series:
https://github.com/linux-test-project/ltp/pull/400

Including an alternative fix to fanotify03 that was Acked-by Jan.

This mostly (but not only) whitespace cleanup is more easy to review on github
or by git diff -w, so not posting patches on mail to reduce the noise.

I added to the cleanup SPDX tags and some fixes to printed messages.

This cleanup is the base for adding test cases for new feature, which I aim
to post after the next kernel merge window.

Thanks,
Amir.

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

end of thread, other threads:[~2018-09-28  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 14:56 [LTP] [PATCH] syscalls/fanotify03: Cleanup backup file descriptor Amir Goldstein
2018-09-12  7:01 ` Richard Palethorpe
2018-09-28  7:39   ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox