+2002-07-14 Theodore Ts'o <tytso@mit.edu>
+
+ * unix_io.c (unix_open): Only attempt the setrlimit workaround if
+ the kernel version is 2.4.10 -- 2.4.17, since otherwise an
+ old version of glibc (built against 2.2 headers) will
+ interact badly with the workaround to actually cause more
+ problems. I hate it when the glibc folks think they're
+ being smarter than the kernel....
+
2002-06-28 Andreas Dilger <adilger@clusterfs.com>
* ext2_fs.h: Add superblock field for reserved group descriptors.
#endif
#include <fcntl.h>
#include <time.h>
+#ifdef __linux__
+#include <sys/utsname.h>
+#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
errcode_t retval;
int open_flags;
struct stat st;
+#ifdef __linux__
+ struct utsname ut;
+#endif
if (name == 0)
return EXT2_ET_BAD_DEVICE_NAME;
#define RLIM_INFINITY (~0UL)
#endif
/*
- * Work around a bug in 2.4.10+ kernels where writes to block
- * devices are wrongly getting hit by the filesize limit.
+ * Work around a bug in 2.4.10-2.4.18 kernels where writes to
+ * block devices are wrongly getting hit by the filesize
+ * limit. This workaround isn't perfect, since it won't work
+ * if glibc wasn't built against 2.2 header files. (Sigh.)
+ *
*/
- if ((flags & IO_FLAG_RW) &&
+ if ((flags & IO_FLAG_RW) &&
+ (uname(&ut) == 0) &&
+ ((ut.release[0] == '2') && (ut.release[1] == '.') &&
+ (ut.release[2] == '4') && (ut.release[3] == '.') &&
+ (ut.release[4] == '1') && (ut.release[5] >= '0') &&
+ (ut.release[5] < '8')) &&
(fstat(data->dev, &st) == 0) &&
(S_ISBLK(st.st_mode))) {
struct rlimit rlim;