summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2002-10-31 12:21:05 -0500
committerTheodore Ts'o <tytso@mit.edu>2002-10-31 12:21:05 -0500
commit55ca9ae5ecc5968e272e900b3e6e815fdeae683b (patch)
tree348fdded498e38b21ebd84c7eda7806ea917237a /lib/ext2fs
parent1dd090faa03a781492791ce9eacf4fd5ecbf425f (diff)
downloade2fsprogs-55ca9ae5ecc5968e272e900b3e6e815fdeae683b.tar.gz
flushb.c (ext2fs_sync_device): If the BLKFLSBUF ioctl succeeds,
don't try the FDFLUSH ioctl that was required for floppies with older kernels. This avoids needless whining from the MD device driver. (Addresses Sourceforge bug #545832).
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/ChangeLog5
-rw-r--r--lib/ext2fs/flushb.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 5f7d43b6..d1e4f18d 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,5 +1,10 @@
2002-10-31 Theodore Ts'o <tytso@mit.edu>
+ * flushb.c (ext2fs_sync_device): If the BLKFLSBUF ioctl succeeds,
+ don't try the FDFLUSH ioctl that was required for floppies
+ with older kernels. This avoids needless whining from the
+ MD device driver. (Addresses Sourceforge bug #545832).
+
* openfs.c (ext2fs_open): Fix bug which caused us to pass the
wrong group_block to ext2fs_descriptor_block_loc if we're
using the backup superblock/block group descriptors.
diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c
index 282dca37..ed4d3901 100644
--- a/lib/ext2fs/flushb.c
+++ b/lib/ext2fs/flushb.c
@@ -62,12 +62,13 @@ errcode_t ext2fs_sync_device(int fd, int flushb)
if (flushb) {
#ifdef BLKFLSBUF
- ioctl (fd, BLKFLSBUF, 0); /* In case this is a HD */
+ if (ioctl (fd, BLKFLSBUF, 0) == 0)
+ return 0;
#else
#warning BLKFLSBUF not defined
#endif
#ifdef FDFLUSH
- ioctl (fd, FDFLUSH, 0); /* In case this is floppy */
+ ioctl (fd, FDFLUSH, 0); /* In case this is a floppy */
#else
#warning FDFLUSH not defined
#endif