Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 14 Feb 2001 10:57:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 14 Feb 2001 10:57:02 -0500 Received: from smtp6.us.dell.com ([143.166.83.101]:7955 "EHLO smtp6.us.dell.com") by vger.kernel.org with ESMTP id ; Wed, 14 Feb 2001 10:56:45 -0500 Date: Wed, 14 Feb 2001 09:56:43 -0600 (CST) From: Michael E Brown Reply-To: Michael E Brown To: cc: , Subject: Re: block ioctl to read/write last sector In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Feb 2001 Andries.Brouwer@cwi.nl 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 us: if (blk_size[MAJOR(dev)]) size = ((loff_t) blk_size[MAJOR(dev)][MINOR(dev)] << BLOCK_SIZE_BITS) >> blocksize_bits; else 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/