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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 7 Jan 2011 18:54:49 -0500
From:	Ted Ts'o <tytso@....edu>
To:	Christoph Hellwig <hch@....de>
Cc:	"Darrick J. Wong" <djwong@...ibm.com>,
	Jens Axboe <axboe@...nel.dk>, Neil Brown <neilb@...e.de>,
	Andreas Dilger <adilger.kernel@...ger.ca>,
	Alasdair G Kergon <agk@...hat.com>, Jan Kara <jack@...e.cz>,
	Mike Snitzer <snitzer@...hat.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	linux-raid@...r.kernel.org, Keith Mannthey <kmannth@...ibm.com>,
	dm-devel@...hat.com, Mingming Cao <cmm@...ibm.com>,
	Tejun Heo <tj@...nel.org>, linux-ext4@...r.kernel.org,
	Ric Wheeler <rwheeler@...hat.com>,
	Josef Bacik <josef@...hat.com>
Subject: Patch to issue pure flushes directly (Was: Re: [PATCH v6 0/4]
 ext4: Coordinate data-only flush requests sent) by fsync

This patch seemed like a good idea to me; I just checked linux-next,
and looks like nothing like this is planned to be merged.  Just
thought I would send a prod-o-gram to see what the current thinking
was around adding something like this.

Thanks,

						- Ted


On Tue, Nov 30, 2010 at 05:41:24PM +0100, Christoph Hellwig wrote:
> FYI, here's an updated version of my patch to not run pure flushes
> that also works on SCSI/ATA and not just virtio.  I suspect the patch
> alone might not be enough, but together with a variant of Neil's
> suggestion might do the trick, with my patch taking care of the
> highend-devices and Neil's scheme of taking care of stupid SATA disks.
> 
> 
> Index: linux-2.6/block/blk-flush.c
> ===================================================================
> --- linux-2.6.orig/block/blk-flush.c	2010-11-30 17:27:33.108254088 +0100
> +++ linux-2.6/block/blk-flush.c	2010-11-30 17:27:38.790004333 +0100
> @@ -143,6 +143,17 @@ struct request *blk_do_flush(struct requ
>  	unsigned skip = 0;
>  
>  	/*
> +	 * Just issue pure flushes directly.
> +	 */
> +	if (!blk_rq_sectors(rq)) {
> +		if (!do_preflush) {
> +			__blk_end_request_all(rq, 0);
> +			return NULL;
> +		}
> +		return rq;
> +	}
> +
> +	/*
>  	 * Special case.  If there's data but flush is not necessary,
>  	 * the request can be issued directly.
>  	 *
> Index: linux-2.6/drivers/scsi/scsi_lib.c
> ===================================================================
> --- linux-2.6.orig/drivers/scsi/scsi_lib.c	2010-11-30 17:27:33.120254298 +0100
> +++ linux-2.6/drivers/scsi/scsi_lib.c	2010-11-30 17:27:38.791003634 +0100
> @@ -1060,7 +1060,7 @@ int scsi_setup_blk_pc_cmnd(struct scsi_d
>  	 * that does not transfer data, in which case they may optionally
>  	 * submit a request without an attached bio.
>  	 */
> -	if (req->bio) {
> +	if (req->bio && !(req->cmd_flags & REQ_FLUSH)) {
>  		int ret;
>  
>  		BUG_ON(!req->nr_phys_segments);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ