All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Cc: viro@zeniv.linux.org.uk, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFC] partitions: let partitions inherit policy from disk
Date: Tue, 4 Jul 2006 10:02:16 +0200	[thread overview]
Message-ID: <20060704080215.GS4038@suse.de> (raw)
In-Reply-To: <44A90B9A.5080805@de.ibm.com>

On Mon, Jul 03 2006, Peter Oberparleiter wrote:
> I'd like to suggest to change the partition code in
> fs/partitions/check.c to initialize a newly detected partition's policy
> field with that of the containing block device (see patch below).
> 
> My reasoning is that function set_disk_ro() in block/genhd.c
> modifies the policy field (read-only indicator) of a disk and all
> contained partitions. When a partition is detected after the call to
> set_disk_ro(), the policy field of this partition will currently not
> inherit the disk's policy field. This behavior poses a problem in cases
> where a block device can be 'logically de- and reactivated' like e.g.
> the s390 DASD driver because partition detection may run after the
> policy field has been modified.
> 
> From: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
> 
> Initialize the policy field of partitions with that of the containing
> block device.
> 
> Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
> ---
> diff -Naurp linux-2.6.17/fs/partitions/check.c linux-2.6.17b/fs/partitions/check.c
> --- linux-2.6.17/fs/partitions/check.c	2006-06-18 03:49:35.000000000 +0200
> +++ linux-2.6.17b/fs/partitions/check.c	2006-07-03 12:49:13.000000000 +0200
> @@ -348,6 +348,7 @@ void add_partition(struct gendisk *disk,
>  	p->start_sect = start;-
>  	p->nr_sects = len;
>  	p->partno = part;
> +	p->policy = disk->policy;
> 
>  	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor + part),
>  			S_IFBLK|S_IRUSR|S_IWUSR,

Makes sense to me, however I'll let Al ack this for inclusion. Al?

-- 
Jens Axboe


  reply	other threads:[~2006-07-04  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03 12:20 [PATCH/RFC] partitions: let partitions inherit policy from disk Peter Oberparleiter
2006-07-04  8:02 ` Jens Axboe [this message]
2006-07-04 11:26   ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060704080215.GS4038@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.oberparleiter@de.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.