From: Stefan Liebler <stli@linux.ibm.com>
To: DJ Delorie <dj@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Ensure that nsswitch.conf for nss/tst-reload[12] are really synced.
Date: Thu, 11 Mar 2021 09:25:33 +0100 [thread overview]
Message-ID: <442a55d4-accc-e736-1fd0-62b2c729d167@linux.ibm.com> (raw)
In-Reply-To: <xnmtvarfq7.fsf@rhel8.vm>
On 3/10/21 8:06 PM, DJ Delorie wrote:
>
>> Unfortunately on a fresh git clone, all the nsswitch files have
>> the same size of 40bytes and timestamp:
>
> Please try this:
>
> diff --git a/support/test-container.c b/support/test-container.c
> index 28cc44d9f1..94498d3901 100644
> --- a/support/test-container.c
> +++ b/support/test-container.c
> @@ -481,7 +481,7 @@ need_sync (char *ap, char *bp, struct stat *a, struct stat *b)
> }
>
> static void
> -rsync_1 (path_buf * src, path_buf * dest, int and_delete)
> +rsync_1 (path_buf * src, path_buf * dest, int and_delete, int force_copies)
> {
> DIR *dir;
> struct dirent *de;
> @@ -491,8 +491,9 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete)
> r_append ("/", dest);
>
> if (verbose)
> - printf ("sync %s to %s %s\n", src->buf, dest->buf,
> - and_delete ? "and delete" : "");
> + printf ("sync %s to %s%s%s\n", src->buf, dest->buf,
> + and_delete ? " and delete" : "",
> + force_copies ? " (forced)" : "");
>
> size_t staillen = src->len;
>
> @@ -521,10 +522,10 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete)
> missing. */
> lstat (dest->buf, &d);
>
> - if (! need_sync (src->buf, dest->buf, &s, &d))
> + if (! force_copies && ! need_sync (src->buf, dest->buf, &s, &d))
> {
> if (S_ISDIR (s.st_mode))
> - rsync_1 (src, dest, and_delete);
> + rsync_1 (src, dest, and_delete, force_copies);
> continue;
> }
>
> @@ -559,7 +560,7 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete)
> if (verbose)
> printf ("+D %s\n", dest->buf);
> maybe_xmkdir (dest->buf, (s.st_mode & 0777) | 0700);
> - rsync_1 (src, dest, and_delete);
> + rsync_1 (src, dest, and_delete, force_copies);
> break;
>
> case S_IFLNK:
> @@ -639,12 +640,12 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete)
> }
>
> static void
> -rsync (char *src, char *dest, int and_delete)
> +rsync (char *src, char *dest, int and_delete, int force_copies)
> {
> r_setup (src, &spath);
> r_setup (dest, &dpath);
>
> - rsync_1 (&spath, &dpath, and_delete);
> + rsync_1 (&spath, &dpath, and_delete, force_copies);
> }
>
> \f
> @@ -846,11 +847,11 @@ main (int argc, char **argv)
> do_ldconfig = true;
>
> rsync (pristine_root_path, new_root_path,
> - file_exists (concat (command_root, "/preclean.req", NULL)));
> + file_exists (concat (command_root, "/preclean.req", NULL)), 0);
>
> if (stat (command_root, &st) >= 0
> && S_ISDIR (st.st_mode))
> - rsync (command_root, new_root_path, 0);
> + rsync (command_root, new_root_path, 0, 1);
>
> new_objdir_path = xstrdup (concat (new_root_path,
> support_objdir_root, NULL));
> @@ -1044,7 +1045,7 @@ main (int argc, char **argv)
>
> /* Child has exited, we can post-clean the test root. */
> printf("running post-clean rsync\n");
> - rsync (pristine_root_path, new_root_path, 1);
> + rsync (pristine_root_path, new_root_path, 1, 0);
>
> if (WIFEXITED (status))
> exit (WEXITSTATUS (status));
>
Hi DJ,
with your patch, the files are synced and I've successfully rerun
nss/tst-reload1 multiple times. Rerunning nss/tst-reload2 after
nss/tst-reload1 and the other way around is also fine.
Please commit your patch and also mention
"Bug 27537 - [2.33/2.34 Regression] FAIL: nss/tst-reload2"
(I've just added a comment there)
Then my patch is not needed anymore.
Bye,
Stefan
prev parent reply other threads:[~2021-03-11 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 15:22 Stefan Liebler
2021-03-10 16:26 ` H.J. Lu
2021-03-11 8:25 ` Stefan Liebler
2021-03-10 18:29 ` DJ Delorie
2021-03-10 19:06 ` DJ Delorie
2021-03-11 8:25 ` Stefan Liebler [this message]
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=442a55d4-accc-e736-1fd0-62b2c729d167@linux.ibm.com \
--to=stli@linux.ibm.com \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).