ext3/4 fsyncdata does not flush disk cache
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Surbhi Palande |
Bug Description
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/
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,
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
NonfreeKernelMo
Package: linux-image-
ProcCmdLine: root=UUID=
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/zsh
ProcVersionSign
RelatedPackageV
linux-
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.
dmi.board.name: M3A78-EM
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev X.0x
dmi.chassis.
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.name: System Product Name
dmi.product.
dmi.sys.vendor: System manufacturer
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: karmic |
Changed in linux (Ubuntu): | |
assignee: | nobody → Surbhi Palande (csurbhi) |
importance: | Low → Medium |
status: | Confirmed → In Progress |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Released |
Note that I have also confirmed this bug in Hardy.