unconditionally sync device

master N2006_11_11_010308
szaka 2006-11-10 23:08:06 +00:00
parent 40ea28867d
commit f8d6b01e99
2 changed files with 2 additions and 3 deletions

View File

@ -271,7 +271,7 @@ static s64 ntfs_device_unix_io_pwrite(struct ntfs_device *dev, const void *buf,
*/
static int ntfs_device_unix_io_sync(struct ntfs_device *dev)
{
if (!NDevReadOnly(dev) && NDevDirty(dev)) {
if (!NDevReadOnly(dev)) {
int res = fsync(DEV_FD(dev));
if (!res)
NDevClearDirty(dev);

View File

@ -114,8 +114,7 @@ static void __ntfs_volume_release(ntfs_volume *v)
if (v->dev) {
struct ntfs_device *dev = v->dev;
if (NDevDirty(dev))
dev->d_ops->sync(dev);
dev->d_ops->sync(dev);
if (dev->d_ops->close(dev))
ntfs_log_perror("Failed to close the device");
}