The Samba-Bugzilla – Attachment 5313 Details for
Bug 6942
Avoid fragmentation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
cherrypick for 3-4-test 2
0002-s3-check-if-glibc-has-broken-posix_fallocate.patch (text/x-patch), 2.12 KB, created by
Olaf Flebbe
on 2010-02-10 04:19:16 UTC
(
hide
)
Description:
cherrypick for 3-4-test 2
Filename:
MIME Type:
Creator:
Olaf Flebbe
Created:
2010-02-10 04:19:16 UTC
Size:
2.12 KB
patch
obsolete
>From a68098ead21c0731129021813508078efbc44be8 Mon Sep 17 00:00:00 2001 >From: =?utf-8?q?Bj=C3=B6rn=20Jacke?= <bj@sernet.de> >Date: Fri, 4 Dec 2009 23:26:47 +0100 >Subject: [PATCH] s3: check if glibc has broken posix_fallocate > >cherry picked from commit: 5062e190ed27e16145d9275533b6dd5bcb10209e >--- > source3/configure.in | 16 ++++++++++++++++ > source3/lib/system.c | 2 +- > 2 files changed, 17 insertions(+), 1 deletions(-) > >diff --git a/source3/configure.in b/source3/configure.in >index c5569da..4857d82 100644 >--- a/source3/configure.in >+++ b/source3/configure.in >@@ -2740,6 +2740,22 @@ exit(1); > fi > fi > >+# glibc up to 2.3.6 had dangerously broken posix_fallocate(). DON'T USE IT. >+AC_CACHE_CHECK([for broken posix_fallocate],samba_cv_HAVE_BROKEN_POSIX_FALLOCATE,[ >+AC_TRY_COMPILE([ >+ #define _XOPEN_SOURCE 600 >+ #include <stdlib.h> >+ #if defined(__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 4)) >+ probably broken posix_fallocate >+ #endif >+], [ >+], >+samba_cv_HAVE_BROKEN_POSIX_FALLOCATE=no,samba_cv_HAVE_BROKEN_POSIX_FALLOCATE=yes)]) >+if test x"$samba_cv_HAVE_BROKEN_POSIX_FALLOCATE" = xyes; then >+ AC_DEFINE(HAVE_BROKEN_POSIX_FALLOCATE,, Whether we have a broken posix_fallocate) >+fi >+ >+ > AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[ > AC_TRY_COMPILE([#include <sys/types.h> > #include <sys/stat.h> >diff --git a/source3/lib/system.c b/source3/lib/system.c >index 915d7ca..226a8d1 100644 >--- a/source3/lib/system.c >+++ b/source3/lib/system.c >@@ -344,7 +344,7 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf) > /******************************************************************* > An posix_fallocate() wrapper that will deal with 64 bit filesizes. > ********************************************************************/ >-#if defined(HAVE_POSIX_FALLOCATE64) || defined(HAVE_POSIX_FALLOCATE) >+#if (defined(HAVE_POSIX_FALLOCATE64) || defined(HAVE_POSIX_FALLOCATE)) && !defined(HAVE_BROKEN_POSIX_FALLOCATE) > int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len) > { > #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_POSIX_FALLOCATE64) >-- >1.6.0.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6942
:
5027
|
5028
|
5032
|
5033
|
5065
|
5066
|
5312
|
5313
|
5314
|
5315
|
5317
|
5359
|
5360