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]
Date:	Mon, 26 Jan 2015 12:57:53 -0500
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Ming Lei <ming.lei@...onical.com>
Cc:	linux-kernel@...r.kernel.org,
	Dave Kleikamp <dave.kleikamp@...cle.com>,
	Jens Axboe <axboe@...nel.dk>, Zach Brown <zab@...bo.net>,
	Christoph Hellwig <hch@...radead.org>,
	Maxim Patlasov <mpatlasov@...allels.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Benjamin LaHaise <bcrl@...ck.org>
Subject: Re: [PATCH v2 3/4] block: loop: introduce 'use_aio' sysfs file

Ming Lei <ming.lei@...onical.com> writes:

> So that users can control if kernel aio is used to submit I/O.

How would a user know to choose aio or, um, /not/ aio?  At the very
least, documentation is required for this.  I'd rather see the option
disappear completely, though.

Cheers,
Jeff

>
> Signed-off-by: Ming Lei <ming.lei@...onical.com>
> ---
>  drivers/block/loop.c |   33 +++++++++++++++++++++++++++++++++
>  drivers/block/loop.h |    1 +
>  2 files changed, 34 insertions(+)
>
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index d1f168b..47af456 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -659,6 +659,38 @@ static ssize_t loop_attr_partscan_show(struct loop_device *lo, char *buf)
>  	return sprintf(buf, "%s\n", partscan ? "1" : "0");
>  }
>  
> +static ssize_t loop_attr_do_show_use_aio(struct device *dev,
> +				struct device_attribute *attr, char *buf)
> +{
> +	struct gendisk *disk = dev_to_disk(dev);
> +	struct loop_device *lo = disk->private_data;
> +
> +	return sprintf(buf, "%s\n", lo->use_aio ? "1" : "0");
> +}
> +
> +ssize_t loop_attr_do_store_use_aio(struct device *dev,
> +		struct device_attribute *attr, const char *buf,
> +		size_t count)
> +{
> +	struct gendisk *disk = dev_to_disk(dev);
> +	struct loop_device *lo = disk->private_data;
> +	int err;
> +	unsigned long v;
> +
> +	err = kstrtoul(buf, 10, &v);
> +	if (err < 0)
> +		return err;
> +	if (v)
> +		lo->use_aio = true;
> +	else
> +		lo->use_aio = false;
> +	return count;
> +}
> +
> +static struct device_attribute loop_attr_use_aio =
> +	__ATTR(use_aio, S_IRUGO | S_IWUSR, loop_attr_do_show_use_aio,
> +			loop_attr_do_store_use_aio);
> +
>  LOOP_ATTR_RO(backing_file);
>  LOOP_ATTR_RO(offset);
>  LOOP_ATTR_RO(sizelimit);
> @@ -671,6 +703,7 @@ static struct attribute *loop_attrs[] = {
>  	&loop_attr_sizelimit.attr,
>  	&loop_attr_autoclear.attr,
>  	&loop_attr_partscan.attr,
> +	&loop_attr_use_aio.attr,
>  	NULL,
>  };
>  
> diff --git a/drivers/block/loop.h b/drivers/block/loop.h
> index 301c27f..15049e9 100644
> --- a/drivers/block/loop.h
> +++ b/drivers/block/loop.h
> @@ -57,6 +57,7 @@ struct loop_device {
>  	struct list_head	write_cmd_head;
>  	struct work_struct	write_work;
>  	bool			write_started;
> +	bool			use_aio;
>  	int			lo_state;
>  	struct mutex		lo_ctl_mutex;
--
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