lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A9D669F.1040508@redhat.com>
Date:	Tue, 01 Sep 2009 13:23:27 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	Christoph Hellwig <hch@....de>
CC:	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: fix cache flish in ext4_sync_file

Christoph Hellwig wrote:
> We need to flush the write cache unconditionally in ->fsync, otherwise
> writes into already allocated blocks can get lost.  Writes into fully
> allocated files are very common when using disk images for
> virtualization, and without this fix can easily lose data after
> an fdatasync, which is the typical implementation for a cache flush on
> the virtual drive.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@....de>

Fixing my old commit, I guess ;)

Seems right to me

Acked-by: Eric Sandeen <sandeen@...hat.com>


> Index: linux-2.6/fs/ext4/fsync.c
> ===================================================================
> --- linux-2.6.orig/fs/ext4/fsync.c
> +++ linux-2.6/fs/ext4/fsync.c
> @@ -92,9 +92,9 @@ int ext4_sync_file(struct file *file, st
>  			.nr_to_write = 0, /* sys_fsync did this */
>  		};
>  		ret = sync_inode(inode, &wbc);
> -		if (journal && (journal->j_flags & JBD2_BARRIER))
> -			blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
>  	}
>  out:
> +	if (journal && (journal->j_flags & JBD2_BARRIER))
> +		blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
>  	return ret;
>  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ