[Bugs] [Bug 1138897] NetBSD port

bugzilla at redhat.com bugzilla at redhat.com
Tue Sep 30 16:50:30 UTC 2014


https://bugzilla.redhat.com/show_bug.cgi?id=1138897



--- Comment #37 from Anand Avati <aavati at redhat.com> ---
COMMIT: http://review.gluster.org/8860 committed in release-3.6 by Vijay Bellur
(vbellur at redhat.com) 
------
commit 912eec63f43fda453e4210bfa82336a877a15d38
Author: Emmanuel Dreyfus <manu at netbsd.org>
Date:   Mon Sep 29 03:15:20 2014 +0200

    Fix invalid seekdir() usage

    According to POSIX, seekdir() should only be given offset obtained from
    telldir() on the same DIR *
    http://pubs.opengroup.org/onlinepubs/9699919799/functions/seekdir.html

    Code from afr-self-heald.c and index.c is operating outside of the
    specification, by doing using seekdir() with offset from a previously
    open/close/re-open directory. This seems to work on Linux (although with
    no guarantee it will always in the future). On NetBSD the seekdir()
    with a in invalid offset is a nilpotent operation, and causes an infinite
    loop, since index_fill_readdir() always restart from the beginning of the
    directory.

    The situation is fixed by using a non anonymous fd in afr-self-heald.c:
    we explicitely open the directory so that it remains open on the brick
    side during the timeframe where we want to reuse offsets in seekdir().
    This requires adding an opendir fop in index xlator.

    If the brick was not updated, the opendir will fail and we fallback
    to the standard violating approach for backward compatibility on Linux.
    On other systems we fail since it never worked.

    While there, add tests to check seekdir() success in index and posix
    xlators, so that incorrect usage from calling code produce an explicit
    error instead of an infinite loop. We can only do it on non Linux systems,
    for the sake of backward compatibility when the brick was updated but
    not the client.

    Backport of I88ca90acfcfee280988124bd6addc1a1893ca7ab

    BUG: 1138897
    Change-Id: I5446a9a17d5451ec5aab8fbd10d381da9a0a23ad
    Signed-off-by: Emmanuel Dreyfus <manu at netbsd.org>
    Reviewed-on: http://review.gluster.org/8860
    Tested-by: Gluster Build System <jenkins at build.gluster.com>
    Reviewed-by: Pranith Kumar Karampuri <pkarampu at redhat.com>
    Reviewed-by: Vijay Bellur <vbellur at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=njZVYX2IaV&a=cc_unsubscribe


More information about the Bugs mailing list