mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <freitag@alancoxonachip.com>
To: michael_e_brown@dell.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] block ioctl to read/write last sector
Date: 07 Feb 2001 15:34:50 +0100	[thread overview]
Message-ID: <ouplmrimuid.fsf@pigdrop.muc.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.30.0102061520480.26194-200000@blap.linuxdev.us.dell.com>
In-Reply-To: Michael E Brown's message of "6 Feb 2001 22:38:28 +0100"

Michael E Brown <michael_e_brown@dell.com> writes:

> Problem Summary:
>   There is no function exported to userspace to read or write the last
> 512-byte sector of an odd-size disk.
> 
>   The block device uses 1K blocksize, and will prevent userspace from
> seeing the odd-block at the end of the disk, if the disk is odd-size.
> 
>   IA-64 architecture defines a new partitioning scheme where there is a
> backup of the partition table header in the last sector of the disk. While
> we can read and write to this sector in the kernel partition code, we have
> no way for userspace to update this partition block.
> 
> Solution:
>   As an interim solution, I propose the following IOCTLs for the block
> device layer: BLKGETLASTSECT and BLKSETLASTSECT.  These ioctls will take a
> userspace pointer to a char[512] and read/write the last sector. Below is
> a patch to do this.

But what happens when you e.g. run a software blocksize of 4096 and the device
has >1 inaccessible 512 byte sector at the end?
I think it would be better to pass in a offset in 512 byte units to a special
ioctl (and do error checking in the driver for impossible requests)

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-02-07 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-06 21:34 Michael E Brown
2001-02-07 14:34 ` Andi Kleen [this message]
2001-02-07 15:35   ` Michael E Brown

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=ouplmrimuid.fsf@pigdrop.muc.suse.de \
    --to=freitag@alancoxonachip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael_e_brown@dell.com \
    /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

all inboxes | Powered by JetHome®