linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: jeff@garzik.org, linux-ide@vger.kernel.org,
	jens.axboe@oracle.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, ben@decadent.org.uk
Subject: Re: [PATCHSET] libata: implement ->set_capacity()
Date: Thu, 13 May 2010 12:18:51 -0500	[thread overview]
Message-ID: <1273771131.4353.300.camel@mulgrave.site> (raw)
In-Reply-To: <4BEC2ED7.9080001@kernel.org>

On Thu, 2010-05-13 at 18:54 +0200, Tejun Heo wrote:
> Hello,
> 
> On 05/13/2010 06:38 PM, James Bottomley wrote:
> > Instead of making this a block sysfs attribute, since HPA is SATA only,
> > why not make it a libata attribute for the disk?
> > 
> > That way on unlock, you can unlock the HPA and then trigger a partition
> > rescan of the block device (BLKRRPART) ... this is an ioctl, so you need
> > user context, but you have it if you do it from the sysfs write routine.
> > This looks to be a lot simpler than threading it up through SCSI and
> > block.
> 
> This doesn't have anything to do with sysfs.  It's called from block
> partition scan code when it detects a partition extends beyond the end
> of the device.  No user intervention at all and the mechanism has been
> there for quite some years and possibly predates sysfs.  Am I being
> really slow or are you looking at something else?

OK, so maybe I'm misunderstanding what you're trying to do.  I thought
this set_capacity thing was trying to unlock the HPA and then cause
block to see a new capacity ... the latter is what calling BLKRRPART
from the sysfs write would do.

If it's just to unlock the HPA, then forget the RRPART piece.

So I think the bit I missed was you're trying to do this programatically
from boot time partition read to detect if the user previously disabled
the HPA and partitioned the device?  In which case you still have user
context, you can call BLKRRPART here too.

James

  reply	other threads:[~2010-05-13 17:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 15:56 [PATCHSET] libata: implement ->set_capacity() Tejun Heo
2010-05-13 15:56 ` [PATCH 1/4] block: restart partition scan after resizing a device Tejun Heo
2010-05-13 15:56 ` [PATCH 2/4] SCSI: implement sd_set_capacity() Tejun Heo
2010-05-13 15:56 ` [PATCH 3/4] libata: use the enlarged capacity after late HPA unlock Tejun Heo
2010-05-13 15:56 ` [PATCH 4/4] libata: implement on-demand HPA unlocking Tejun Heo
2010-05-13 16:06 ` [PATCHSET] libata: implement ->set_capacity() James Bottomley
2010-05-13 16:22   ` Tejun Heo
2010-05-13 16:38     ` James Bottomley
2010-05-13 16:54       ` Tejun Heo
2010-05-13 17:18         ` James Bottomley [this message]
2010-05-13 18:40           ` Tejun Heo
2010-05-13 17:13       ` Alan Cox
2010-05-13 17:40     ` Jens Axboe
2010-05-13 18:25       ` Tejun Heo
2010-05-15 13:22 ` Ben Hutchings

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=1273771131.4353.300.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=ben@decadent.org.uk \
    --cc=jeff@garzik.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).