FreeBSD: Unable to locate posix_fadvise64 in libc. Leaving as a no-op.

Bug #1179268 reported by Mikolaj Golub
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Expired
Undecided
Unassigned

Bug Description

Under FreeBSD warnings about missing posix_fadvise64 are observed:

  object-auditor STDOUT: WARNING:root:Unable to locate posix_fadvise64 in libc. Leaving as a no-op.

FreeBSD's libc does not provide posix_fadvise64. It is not needed here because off_t is 8 bytes on both 32 and 64-bit platforms (see the output below).

Could the swift be fixed to call posix_fadvise on FreeBSD instead of posix_fadvise64 (e.g. like in the attached patch)

Additional info about off_t size on FreeBSD i386:

root@ref9-i386:/tmp # uname -a
FreeBSD ref9-i386 9.1-STABLE FreeBSD 9.1-STABLE #4 r250376M: Wed May 8 21:50:09 EEST 2013 <email address hidden>:/home/obj/i386.i386/home/golub/freebsd/base/stable/9/sys/VIMAGE i386
root@ref9-i386:/tmp # man posix_fadvise | head -14
POSIX_FADVISE(2) FreeBSD System Calls Manual POSIX_FADVISE(2)

NAME
     posix_fadvise -- give advice about use of file data

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <fcntl.h>

     int
     posix_fadvise(int fd, off_t offset, off_t len, int advice);

root@ref9-i386:/tmp # cat test_off.c
#include <sys/types.h>

#include <stdio.h>

int
main()
{
        printf("sizeof(off_t) = %zu\n", sizeof(off_t));
        return (0);
}

root@ref9-i386:/tmp # gcc test_off.c
root@ref9-i386:/tmp # ./a.out
sizeof(off_t) = 8

Tags: freebsd
Revision history for this message
Mikolaj Golub (to-my-trociny) wrote :
Revision history for this message
John Dickinson (notmyname) wrote :

Mikolaj, is this still an issue in Swift? If so, can you propose your patch to gerrit for review and inclusion in Swift?

Changed in swift:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Object Storage (swift) because there has been no activity for 60 days.]

Changed in swift:
status: Incomplete → Expired
Revision history for this message
Alistair King (alistairking) wrote :

I can confirm this is still an issue on FreeBSD (10.1), and that the suggested patch fixes the problem.

Revision history for this message
Donny Davis (donny-g) wrote :

Still relevant on Freebsd 12 and patch still works

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.