This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-426-g705a79f


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  705a79f82560ff6472cebed86aa5db04cdea3bce (commit)
      from  934fc4773eec45ec31b03a0244d391cade53f210 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=705a79f82560ff6472cebed86aa5db04cdea3bce

commit 705a79f82560ff6472cebed86aa5db04cdea3bce
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Nov 30 14:59:27 2016 +0100

    libio: Limit buffer size to 8192 bytes [BZ #4099]
    
    This avoids overly large buffers with network file systems which report
    very large block sizes.

diff --git a/ChangeLog b/ChangeLog
index 40f460f..c2cb608 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-30  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #4099]
+	* libio/filedoalloc.c (_IO_file_doallocate): Limit buffer size to
+	_IO_BUFSIZ (8192).
+
 2016-11-30  Carlos O'Donell  <carlos@redhat.com>
 
 	* PROJECTS: Remove file.
diff --git a/NEWS b/NEWS
index 9a45e73..b2a0b0f 100644
--- a/NEWS
+++ b/NEWS
@@ -80,6 +80,12 @@ Version 2.25
   affect the ABI of other libraries that use this type in their interfaces,
   if they are compiled or used with those options.
 
+* The buffer size for byte-oriented stdio streams is now limited to 8192
+  bytes by default.  Previously, on Linux, the default buffer size on most
+  file systems was 4096 bytes (and thus remains unchanged), except on
+  network file systems, where the buffer size was unpredictable and could be
+  as large as several megabytes.
+
 * The <sys/quota.h> header now includes the <linux/quota.h> header.  Support
   for the Linux quota interface which predates kernel version 2.4.22 has
   been removed.
diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c
index 4f9d738..ded0725 100644
--- a/libio/filedoalloc.c
+++ b/libio/filedoalloc.c
@@ -94,7 +94,7 @@ _IO_file_doallocate (_IO_FILE *fp)
 	    fp->_flags |= _IO_LINE_BUF;
 	}
 #if _IO_HAVE_ST_BLKSIZE
-      if (st.st_blksize > 0)
+      if (st.st_blksize > 0 && st.st_blksize < _IO_BUFSIZ)
 	size = st.st_blksize;
 #endif
     }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    6 ++++++
 NEWS                |    6 ++++++
 libio/filedoalloc.c |    2 +-
 3 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]