From patchwork Sun Sep 6 22:00:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Pluzhnikov X-Patchwork-Id: 8589 Received: (qmail 83097 invoked by alias); 6 Sep 2015 22:00:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 83080 invoked by uid 89); 6 Sep 2015 22:00:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f42.google.com MIME-Version: 1.0 X-Received: by 10.202.68.213 with SMTP id r204mr11757752oia.115.1441576828016; Sun, 06 Sep 2015 15:00:28 -0700 (PDT) Date: Sun, 6 Sep 2015 15:00:27 -0700 Message-ID: Subject: [patch] Fix BZ 18675 -- fpathconf(_PC_NAME_MAX) fails against large filesystems for 32bit processes From: Paul Pluzhnikov To: GLIBC Devel Cc: Paul Pluzhnikov , Justin Maggard Greetings, The patch attached to https://sourceware.org/bugzilla/show_bug.cgi?id=18675 looks good to me. I am not sure whether Justin has the paterwork filed, but since this is on the trivial side and is directly patterned after the fix for https://sourceware.org/bugzilla/show_bug.cgi?id=15514, perhaps that's ok? Tested on Linux/x86_64 and i386. No new failures. Thanks, 2015-09-06 Justin Maggard [BZ #18675] * sysdeps/posix/fpathconf.c (__fpathconf): Use __fstatvfs64. diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c index 25f632e..088eb15 100644 --- a/sysdeps/posix/fpathconf.c +++ b/sysdeps/posix/fpathconf.c @@ -66,10 +66,10 @@ __fpathconf (fd, name) case _PC_NAME_MAX: #ifdef NAME_MAX { - struct statfs buf; + struct statvfs64 sv; int save_errno = errno; - if (__fstatfs (fd, &buf) < 0) + if (__fstatvfs64 (fd, &sv) < 0) { if (errno == ENOSYS) { @@ -83,15 +83,7 @@ __fpathconf (fd, name) } else { -#ifdef _STATFS_F_NAMELEN - return buf.f_namelen; -#else -# ifdef _STATFS_F_NAME_MAX - return buf.f_name_max; -# else - return NAME_MAX; -# endif -#endif + return sv.f_namemax; } } #else