Hide Forgot
If we add this to the kernel, we should coordinate with glibc. Is this change amenable to the glibc folks for RHEL6? Thanks, -Eric +++ This bug was initially created as a clone of Bug #691267 +++ ------------------------------------------------------------ commit b7ed78f56575074f29ec99d8984f347f6c99c914 Author: Sage Weil <sage> Date: Thu Mar 10 11:31:30 2011 -0800 introduce sys_syncfs to sync a single file system It is frequently useful to sync a single file system, instead of all mounted file systems via sync(2): - On machines with many mounts, it is not at all uncommon for some of them to hang (e.g. unresponsive NFS server). sync(2) will get stuck on those and may never get to the one you do care about (e.g., /). - Some applications write lots of data to the file system and then want to make sure it is flushed to disk. Calling fsync(2) on each file introduces unnecessary ordering constraints that result in a large amount of sub-optimal writeback/flush/commit behavior by the file system. There are currently two ways (that I know of) to sync a single super_block: - BLKFLSBUF ioctl on the block device: That also invalidates the bdev mapping, which isn't usually desirable, and doesn't work for non-block file systems. - 'mount -o remount,rw' will call sync_filesystem as an artifact of the current implemention. Relying on this little-known side effect for something like data safety sounds foolish. Both of these approaches require root privileges, which some applications do not have (nor should they need?) given that sync(2) is an unprivileged operation. This patch introduces a new system call syncfs(2) that takes an fd and syncs only the file system it references. Maybe someday we can $ sync /some/path and not get sync: ignoring all arguments The syscall is motivated by comments by Al and Christoph at the last LSF. syncfs(2) seems like an appropriate name given statfs(2). A similar ioctl was also proposed a while back, see http://marc.info/?l=linux-fsdevel&m=127970513829285&w=2 Signed-off-by: Sage Weil <sage> Signed-off-by: Al Viro <viro.org.uk> commit c7a1fcd8e6e0c3c8f4f8f74fc926ff04da3bf7a7 Author: Andrew Morton <akpm> Date: Tue Mar 22 16:30:07 2011 -0700 include/asm-generic/unistd.h: fix syncfs syscall number syncfs() is duplicating name_to_handle_at() due to a merging mistake. Cc: Sage Weil <sage> Cc: Al Viro <viro.org.uk> Signed-off-by: Andrew Morton <akpm> Signed-off-by: Linus Torvalds <torvalds> ------------------------------------------------------------ Architecture specific commits: ------------------------------------------------------------ commit 1bbf28756149a0aa0e3c8a74cea9bbe715639027 Author: Ralf Baechle <ralf> Date: Fri Mar 25 18:45:20 2011 +0100 MIPS: Wire up syncfs(2). Signed-off-by: Ralf Baechle <ralf> commit d0d2e31af691ed3dbb4e556bf939b86ef745e6a3 Author: Heiko Carstens <heiko.carstens.com> Date: Wed Mar 23 10:15:58 2011 +0100 [S390] wire up sys_syncfs Signed-off-by: Heiko Carstens <heiko.carstens.com> Signed-off-by: Martin Schwidefsky <schwidefsky.com> commit 4e3d96deff59d126cfa289645e136e295e65480f Author: Mike Frysinger <vapier> Date: Tue Mar 22 13:41:22 2011 -0400 Blackfin: wire up new syncfs syscall Signed-off-by: Mike Frysinger <vapier> commit 9298168d16faf939141cddc836b6b9b1ef2a8aac Author: Tony Luck <tony.luck> Date: Tue Mar 22 10:54:24 2011 -0700 [IA64] New syscalls for 2.6.39 Four new syscalls: sys_name_to_handle_at sys_open_by_handle_at sys_clock_adjtime sys_syncfs Signed-off-by: Tony Luck <tony.luck> commit 2a03cfbd906dc9bbf5e9a97727cf4ba1889d4829 Author: Paul Mundt <lethal> Date: Tue Mar 22 21:56:08 2011 +0900 sh: wire up sys_syncfs. Signed-off-by: Paul Mundt <lethal> ------------------------------------------------------------ --- Additional comment from harshula on 2011-03-27 22:09:50 EDT --- Upstream discussion: http://thread.gmane.org/gmane.linux.file-systems/51497/
No new symbols can be added to glibc. Use syscall(2).
Andreas, this was added to the upstream kernel. This is not a request to change a symbol, just pull in a very relevant performance feature that this new system call introduces. We do not have a "no new syscall" kernel policy, is there some reason that glibc needs to be more static than the kernel for new symbols? We should have a call and discuss this, thanks!
Adding a symbol breaks the ABI.
Andreas, how can adding a new symbol break the abi. It adds to the ABI, no change. Are you of the position that you cannot add new calls to the ABI for the entire life time of a release? Please do no close this without discussion of the policy. We can take this up in a RHEL release meeting.
This has been discussed to death already several times, just search bugzilla. You cannot add a new symbol to glibc without breaking the ABI, or rebasing glibc to the next release.