Re: block ioctl to read/write last sector

From: Michael E Brown (
Date: Wed Feb 14 2001 - 10:56:43 EST

On Wed, 14 Feb 2001 wrote:

> So if you add a 1-block partition that contains the last
> sector of the disk, all should be fine.

Oh! I didn't get your meaning before. I think I understand now. The
problem with this is that the tests for block writeability are not done on
a per-partition basis. They are done on a whole block device basis. see
fs/block_dev.c in block_read() and block_write(). The following test kills

        if (blk_size[MAJOR(dev)])
                size = ((loff_t) blk_size[MAJOR(dev)][MINOR(dev)] <<
BLOCK_SIZE_BITS) >> blocksize_bits;
                size = INT_MAX;
        while (count>0) {
                if (block >= size)
                        return written ? written : -ENOSPC;

Michael Brown
Linux Systems Group
Dell Computer Corp

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Feb 15 2001 - 21:00:24 EST