public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] partitions: let partitions inherit policy from disk
@ 2006-07-03 12:20 Peter Oberparleiter
  2006-07-04  8:02 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Oberparleiter @ 2006-07-03 12:20 UTC (permalink / raw)
  To: viro, Jens Axboe; +Cc: akpm, linux-kernel

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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH/RFC] partitions: let partitions inherit policy from disk
  2006-07-03 12:20 [PATCH/RFC] partitions: let partitions inherit policy from disk Peter Oberparleiter
@ 2006-07-04  8:02 ` Jens Axboe
  2006-07-04 11:26   ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2006-07-04  8:02 UTC (permalink / raw)
  To: Peter Oberparleiter; +Cc: viro, akpm, linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH/RFC] partitions: let partitions inherit policy from disk
  2006-07-04  8:02 ` Jens Axboe
@ 2006-07-04 11:26   ` Al Viro
  0 siblings, 0 replies; 3+ messages in thread
From: Al Viro @ 2006-07-04 11:26 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Peter Oberparleiter, viro, akpm, linux-kernel

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

ACK, looks sane.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-04 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-03 12:20 [PATCH/RFC] partitions: let partitions inherit policy from disk Peter Oberparleiter
2006-07-04  8:02 ` Jens Axboe
2006-07-04 11:26   ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox