xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <dunlapg@umich.edu>
To: Chris Patterson <cjp256@gmail.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Chris Patterson <pattersonc@ainfosec.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v3 1/2] libxl: replace deprecated readdir_r() with readdir()
Date: Wed, 22 Feb 2017 12:04:02 +0000	[thread overview]
Message-ID: <CAFLBxZZFHGq+-xC3mq2uPgSh3X2FnSenHZZh6QMNjG8S9Y=CSw@mail.gmail.com> (raw)
In-Reply-To: <1464972610-24115-1-git-send-email-cjp256@gmail.com>

On Fri, Jun 3, 2016 at 5:50 PM, Chris Patterson <cjp256@gmail.com> wrote:
> From: Chris Patterson <pattersonc@ainfosec.com>
>
> Replace the usage of readdir_r() with readdir() to address a
> compilation error under glibc due to the deprecation of readdir_r
> for their next release (2.24) [1, 2].
>
> Remove code specific to usage of readdir_r which is no longer required,
> such as zalloc_dirent().
>
> --
>
> From the GNU libc manual [3]:
> "
>  It is expected that future versions of POSIX will obsolete readdir_r and
>  mandate the level of thread safety for readdir which is provided by the
>  GNU C Library and other implementations today.
> "
>
> There is a filed bug in the Austin Group Defect Tracker [4]  in which 'dalias'
> proposes (in comment 0001632) that:
> "
>    I would like to propose an alternate solution. For readdir, replace the text:
>     "The readdir() function need not be thread-safe."
>    with:
>     "If multiple threads call the readdir() function with the same directory
>     stream argument and without synchronization to preclude simultaneous
>     access, then the behavior is undefined."
>
>    With this change, the clunky readdir_r function is no longer needed or
>    useful, and should probably be deprecated. As the only reasonable way
>    to meet the implementation requirements for readdir is to have the dirent
>    buffer in the DIR structure, this change should not require any change to
>    existing implementations.
> "
>
> [1] https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html
> [2] https://sourceware.org/bugzilla/show_bug.cgi?id=19056
> [3] https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html
> [4] http://austingroupbugs.net/view.php?id=696
>
> Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>

Jan,

These patches should be backported to the 4.6 branch (and earlier?) as well.

The commits are b9daff9 and c2a1786 if you want to cherry-pick them.
(b9daff9 doesn't apply quite cleanly because libxl_pvusb.c doesn't
exist).

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

      parent reply	other threads:[~2017-02-22 12:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 16:50 [PATCH v3 1/2] libxl: replace deprecated readdir_r() with readdir() Chris Patterson
2016-06-03 16:50 ` [PATCH v3 2/2] libfsimage: " Chris Patterson
2016-06-03 16:58   ` Ian Jackson
2016-06-03 16:59 ` [PATCH v3 1/2] libxl: " Ian Jackson
2016-06-03 17:09   ` Wei Liu
2017-02-22 12:04 ` George Dunlap [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='CAFLBxZZFHGq+-xC3mq2uPgSh3X2FnSenHZZh6QMNjG8S9Y=CSw@mail.gmail.com' \
    --to=dunlapg@umich.edu \
    --cc=JBeulich@suse.com \
    --cc=cjp256@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=pattersonc@ainfosec.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 NNTP newsgroup(s).