* [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
@ 2016-07-11 14:29 Jan Stancek
2016-07-12 13:55 ` Cyril Hrubis
0 siblings, 1 reply; 6+ messages in thread
From: Jan Stancek @ 2016-07-11 14:29 UTC (permalink / raw)
To: ltp
Docs say that SAFE_CLOSE() sets the passed file descriptor to -1
after it's successfully closed, but oldlib SAFE_CLOSE doesn't
do that.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
include/old/safe_macros.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/old/safe_macros.h b/include/old/safe_macros.h
index 6691a15885ab..8ed2eb493960 100644
--- a/include/old/safe_macros.h
+++ b/include/old/safe_macros.h
@@ -26,8 +26,11 @@
#define SAFE_CHDIR(cleanup_fn, path) \
safe_chdir(__FILE__, __LINE__, (cleanup_fn), (path))
-#define SAFE_CLOSE(cleanup_fn, fildes) \
- safe_close(__FILE__, __LINE__, (cleanup_fn), (fildes))
+#define SAFE_CLOSE(cleanup_fn, fd) ({ \
+ int ret = safe_close(__FILE__, __LINE__, (cleanup_fn), (fd)); \
+ fd = -1; \
+ ret; \
+ })
#define SAFE_CREAT(cleanup_fn, pathname, mode) \
safe_creat(__FILE__, __LINE__, cleanup_fn, (pathname), (mode))
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
2016-07-11 14:29 [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs Jan Stancek
@ 2016-07-12 13:55 ` Cyril Hrubis
2016-07-12 16:10 ` Jan Stancek
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2016-07-12 13:55 UTC (permalink / raw)
To: ltp
Hi!
> Docs say that SAFE_CLOSE() sets the passed file descriptor to -1
> after it's successfully closed, but oldlib SAFE_CLOSE doesn't
> do that.
Have you tried to run at least syscalls testsuite after this change?
I do not expect that this will break anything, but there it's a possibility.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
2016-07-12 13:55 ` Cyril Hrubis
@ 2016-07-12 16:10 ` Jan Stancek
2016-07-13 12:52 ` Jan Stancek
0 siblings, 1 reply; 6+ messages in thread
From: Jan Stancek @ 2016-07-12 16:10 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 12 July, 2016 3:55:43 PM
> Subject: Re: [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
>
> Hi!
> > Docs say that SAFE_CLOSE() sets the passed file descriptor to -1
> > after it's successfully closed, but oldlib SAFE_CLOSE doesn't
> > do that.
>
> Have you tried to run at least syscalls testsuite after this change?
That was the plan, but I didn't get to that today.
I was thinking syscalls as well, since most common failure seems
to be errno tests, trying to trigger EBADF, etc.
I'll reply once I have results.
Regards,
Jan
>
> I do not expect that this will break anything, but there it's a possibility.
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
2016-07-13 12:52 ` Jan Stancek
@ 2016-07-13 12:51 ` Cyril Hrubis
2016-07-13 13:20 ` Jan Stancek
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2016-07-13 12:51 UTC (permalink / raw)
To: ltp
Hi!
> > That was the plan, but I didn't get to that today.
> >
> > I was thinking syscalls as well, since most common failure seems
> > to be errno tests, trying to trigger EBADF, etc.
> >
> > I'll reply once I have results.
> >
> > Regards,
> > Jan
> >
> > >
> > > I do not expect that this will break anything, but there it's a
> > > possibility.
>
> I ran syscalls (+small selection of other tests) on x86_64, ppc64le
> and s390x. Only failure was inotify06, but it turned out, that kernel
> didn't have a patch for this specific failure [1]. It failed with or
> without oldlib SAFE_CLOSE patch. inotify06 passed with 4.7.0-rc7+.
Thanks for the testing. Patch is acked.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
2016-07-12 16:10 ` Jan Stancek
@ 2016-07-13 12:52 ` Jan Stancek
2016-07-13 12:51 ` Cyril Hrubis
0 siblings, 1 reply; 6+ messages in thread
From: Jan Stancek @ 2016-07-13 12:52 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Jan Stancek" <jstancek@redhat.com>
> To: "Cyril Hrubis" <chrubis@suse.cz>
> Cc: ltp@lists.linux.it
> Sent: Tuesday, 12 July, 2016 6:10:58 PM
> Subject: Re: [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
>
>
>
>
>
> ----- Original Message -----
> > From: "Cyril Hrubis" <chrubis@suse.cz>
> > To: "Jan Stancek" <jstancek@redhat.com>
> > Cc: ltp@lists.linux.it
> > Sent: Tuesday, 12 July, 2016 3:55:43 PM
> > Subject: Re: [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
> >
> > Hi!
> > > Docs say that SAFE_CLOSE() sets the passed file descriptor to -1
> > > after it's successfully closed, but oldlib SAFE_CLOSE doesn't
> > > do that.
> >
> > Have you tried to run at least syscalls testsuite after this change?
>
> That was the plan, but I didn't get to that today.
>
> I was thinking syscalls as well, since most common failure seems
> to be errno tests, trying to trigger EBADF, etc.
>
> I'll reply once I have results.
>
> Regards,
> Jan
>
> >
> > I do not expect that this will break anything, but there it's a
> > possibility.
I ran syscalls (+small selection of other tests) on x86_64, ppc64le
and s390x. Only failure was inotify06, but it turned out, that kernel
didn't have a patch for this specific failure [1]. It failed with or
without oldlib SAFE_CLOSE patch. inotify06 passed with 4.7.0-rc7+.
Regards,
Jan
[1] https://patchwork.kernel.org/patch/8953231/
> >
> > --
> > Cyril Hrubis
> > chrubis@suse.cz
> >
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
2016-07-13 12:51 ` Cyril Hrubis
@ 2016-07-13 13:20 ` Jan Stancek
0 siblings, 0 replies; 6+ messages in thread
From: Jan Stancek @ 2016-07-13 13:20 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Wednesday, 13 July, 2016 2:51:17 PM
> Subject: Re: [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs
>
> Hi!
> > > That was the plan, but I didn't get to that today.
> > >
> > > I was thinking syscalls as well, since most common failure seems
> > > to be errno tests, trying to trigger EBADF, etc.
> > >
> > > I'll reply once I have results.
> > >
> > > Regards,
> > > Jan
> > >
> > > >
> > > > I do not expect that this will break anything, but there it's a
> > > > possibility.
> >
> > I ran syscalls (+small selection of other tests) on x86_64, ppc64le
> > and s390x. Only failure was inotify06, but it turned out, that kernel
> > didn't have a patch for this specific failure [1]. It failed with or
> > without oldlib SAFE_CLOSE patch. inotify06 passed with 4.7.0-rc7+.
>
> Thanks for the testing. Patch is acked.
Pushed.
Regards,
Jan
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-13 13:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 14:29 [LTP] [PATCH] safe_macros: match oldlib SAFE_CLOSE with docs Jan Stancek
2016-07-12 13:55 ` Cyril Hrubis
2016-07-12 16:10 ` Jan Stancek
2016-07-13 12:52 ` Jan Stancek
2016-07-13 12:51 ` Cyril Hrubis
2016-07-13 13:20 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox