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] [day] [month] [year] [list]
Message-Id: <201012101939.20984.arnd@arndb.de>
Date:	Fri, 10 Dec 2010 19:39:20 +0100
From:	Arnd Bergmann <arnd@...db.de>
To:	Lukas Czerner <lczerner@...hat.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	tytso@....edu, sandeen@...hat.com, adilger.kernel@...ger.ca,
	gregkh@...e.de, hch@...radead.org, axboe@...nel.dk
Subject: Re: [PATCH 2/2] Add BLKGETQUEUEINFO for reading block queue attributes

On Thursday 09 December 2010 16:25:37 Lukas Czerner wrote:
> +enum blkq_info_type {
> +       BLKQ_REQUESTS = 0,
> +       BLKQ_RA,
> +       BLKQ_MAX_HW_SECTORS,
> +       BLKQ_MAX_SECTORS,
> +       BLKQ_MAX_SEGMENTS,
> +       BLKQ_MAX_INTEGRITY_SEGMENTS,
> +       BLKQ_MAX_SEGMENT_SIZE,
> +       BLKQ_IOSCHED,
> +       BLKQ_HW_SECTOR_SIZE,
> +       BLKQ_LOGICAL_BLOCK_SIZE,
> +       BLKQ_PHYSICAL_BLOCK_SIZE,
> +       BLKQ_IO_MIN,
> +       BLKQ_IO_OPT,
> +       BLKQ_DISCARD_GRANULARITY,
> +       BLKQ_DISCARD_MAX,
> +       BLKQ_DISCARD_ZEROES_DATA,
> +       BLKQ_NONROT,
> +       BLKQ_NOMERGES,
> +       BLKQ_RQ_AFFINITY,
> +       BLKQ_IOSTATS,
> +       BLKQ_RANDOM,
> +       BLKQ_END,               /* Last item = quantity of items */
> +};
> +
> +struct blk_queue_info {
> +       enum blkq_info_type type;
> +       unsigned long data;
> +};

You are adding another indirection to an indirect system call
here. Besides the problems that Greg mentioned, this is
also really ugly. If it turns out that we want an ioctl interface
for this after all, better make it either one command per value,
or one data structure that contains all the values (plus some
reserved fields for future extensions).

Furthermore, you should use neither enum nor long data types
in a data structure that is used as an ABI. Use either __u32
or __u64 here, and make sure you have no padding in the middle
or at the end if you mix the two.

> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
> index 30b8815..71bd06c 100644
> --- a/include/linux/sysfs.h
> +++ b/include/linux/sysfs.h
> @@ -112,6 +112,7 @@ struct bin_attribute {
>  struct sysfs_ops {
>         ssize_t (*show)(struct kobject *, struct attribute *,char *);
>         ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
> +       ssize_t (*get)(struct kobject *, struct attribute *, void *);
>  };
>  

This looks like it can significantly add to the .data size of the kernel.

	Arnd
--
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