Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 17 Jan 2002 15:30:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 17 Jan 2002 15:30:19 -0500 Received: from smtp2.us.dell.com ([143.166.82.242]:42974 "EHLO smtp2.us.dell.com") by vger.kernel.org with ESMTP id ; Thu, 17 Jan 2002 15:30:12 -0500 Date: Thu, 17 Jan 2002 14:28:52 -0600 (CST) From: Matt Domsch X-X-Sender: Reply-To: Matt Domsch To: Subject: BLKGETSIZE64 (bytes or sectors?) 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 Is the BLKGETSIZE64 ioctl supposed to return the size of the device in bytes (as the comment says, and is implemented in all places *except* blkpg.c), or in sectors (as is implemented in blkpg.c since 2.4.15)? It would seem that blkpg.c gets it wrong, that it should be in bytes. Assuming that's the case, here's the patch to fix it against 2.4.18-pre4. Thanks, Matt -- Matt Domsch Sr. Software Engineer Dell Linux Solutions www.dell.com/linux #1 US Linux Server provider with 24.5% (IDC Dec 2001) #2 Worldwide Linux Server provider with 18.2% (IDC Dec 2001) --- linux-2.4.18-pre4/drivers/block/blkpg.c.orig Thu Jan 17 14:24:24 2002 +++ linux-2.4.18-pre4/drivers/block/blkpg.c Thu Jan 17 14:26:43 2002 @@ -247,7 +247,7 @@ int blk_ioctl(kdev_t dev, unsigned int c if (cmd == BLKGETSIZE) return put_user((unsigned long)ullval, (unsigned long *)arg); else - return put_user(ullval, (u64 *)arg); + return put_user((u64)ullval << 9 , (u64 *)arg); #if 0 case BLKRRPART: /* Re-read partition tables */ if (!capable(CAP_SYS_ADMIN)) - 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/