+2013-04-03 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #15305]
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ [__LINUX_KERNEL_VERSION >= 0x02061d]: Define
+ __ASSUME_XFS_RESTRICTED_CHOWN.
+ * sysdeps/unix/sysv/linux/pathconf.c
+ (__statfs_chown_restricted) [!__ASSUME_XFS_RESTRICTED_CHOWN]:
+ Save and restore errno.
+
2013-04-02 Joseph Myers <joseph@codesourcery.com>
[BZ #15327]
10357, 11120, 11561, 12723, 13550, 13889, 13951, 14142, 14176, 14200,
14317, 14327, 14496, 14812, 14920, 14964, 14981, 14982, 14985, 14994,
14996, 15003, 15006, 15020, 15023, 15036, 15054, 15055, 15062, 15078,
- 15160, 15214, 15232, 15234, 15283, 15285, 15287, 15304, 15307, 15327.
+ 15160, 15214, 15232, 15234, 15283, 15285, 15287, 15304, 15305, 15307,
+ 15327.
* Add support for calling C++11 thread_local object destructors on thread
and program exit. This needs compiler support for offloading C++11
#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
# define __ASSUME_GETCPU_SYSCALL 1
#endif
+
+/* 2.6.29 removed the XFS restricted_chown sysctl, so it is pointless looking
+ for it in newer kernels. */
+#if __LINUX_KERNEL_VERSION >= 0x02061d
+# define __ASSUME_XFS_RESTRICTED_CHOWN 1
+#endif
return -1;
}
+#if __ASSUME_XFS_RESTRICTED_CHOWN
+ return 1;
+#else
int fd;
+ int save_errno;
long int retval = 1;
switch (fsbuf->f_type)
{
case XFS_SUPER_MAGIC:
+ save_errno = errno;
/* Read the value from /proc/sys/fs/xfs/restrict_chown. If we cannot
read it default to assume the restriction is in place. */
fd = open_not_cancel_2 ("/proc/sys/fs/xfs/restrict_chown", O_RDONLY);
close_not_cancel_no_status (fd);
}
+ __set_errno (save_errno);
break;
default:
}
return retval;
+#endif
}