Public bug reported: The following program illustrates the problem. When run, on ext3 or ext4 with data=ordered or data=writeback, it completes under a second. Since each fsyncdata should take at least one disk revolution (~10ms), the total time taken should be ~10 seconds.
The program works as expected (i.e. takes ~10 seconds or more) for the following cases: XFS, reiserfs, and ext4 with data=journal. It works correctly when replacing the pwrite with a write. It also works as expected when the drive cache is disabled. This bug will likely cause database systems to fail to commit transactions in a durable manner. #include <stdio.h> #include <fcntl.h> int main() { int fd = open ("test_file", O_RDWR | O_CREAT | O_TRUNC, 0600); char byte; int i = 1000; while (i-- > 0) { byte = i&0xFF; pwrite (fd, &byte, 1, 0); fdatasync (fd); } } ProblemType: Bug Architecture: i386 AudioDevicesInUse: USER PID ACCESS COMMAND /dev/snd/controlC0: guest1 2176 F.... pulseaudio CRDA: country CO: (2402 - 2472 @ 40), (3, 27) (5170 - 5250 @ 20), (3, 17) (5250 - 5330 @ 20), (3, 23), DFS (5735 - 5835 @ 20), (3, 30) Card0.Amixer.info: Card hw:0 'SB'/'HDA ATI SB at 0xf7ff4000 irq 16' Mixer name : 'Realtek ALC1200' Components : 'HDA:10ec0888,104382fe,00100101' Controls : 40 Simple ctrls : 22 Date: Thu Jan 7 22:41:51 2010 DistroRelease: Ubuntu 9.10 HibernationDevice: RESUME=/dev/sda6 MachineType: System manufacturer System Product Name NonfreeKernelModules: nvidia Package: linux-image-2.6.31-16-generic 2.6.31-16.53 ProcCmdLine: root=UUID=305df5de-09e0-4f0f-98fe-eda2d4f95e0a ro ProcEnviron: PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/zsh ProcVersionSignature: Ubuntu 2.6.31-16.53-generic RelatedPackageVersions: linux-backports-modules-2.6.31-16-generic N/A linux-firmware 1.25 RfKill: 0: phy0: Wireless LAN Soft blocked: no Hard blocked: no SourcePackage: linux Uname: Linux 2.6.31-16-generic i686 WpaSupplicantLog: dmi.bios.date: 08/28/2008 dmi.bios.vendor: American Megatrends Inc. dmi.bios.version: 0701 dmi.board.asset.tag: To Be Filled By O.E.M. dmi.board.name: M3A78-EM dmi.board.vendor: ASUSTeK Computer INC. dmi.board.version: Rev X.0x dmi.chassis.asset.tag: Asset-1234567890 dmi.chassis.type: 3 dmi.chassis.vendor: Chassis Manufacture dmi.chassis.version: Chassis Version dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0701:bd08/28/2008:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnM3A78-EM:rvrRevX.0x:cvnChassisManufacture:ct3:cvrChassisVersion: dmi.product.name: System Product Name dmi.product.version: System Version dmi.sys.vendor: System manufacturer ** Affects: linux (Ubuntu) Importance: Undecided Status: New ** Tags: apport-bug i386 -- ext3/4 fsyncdata does not flush disk cache https://bugs.launchpad.net/bugs/504632 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs