From patchwork Sat Aug 1 14:59:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Lord X-Patchwork-Id: 30456 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id D8312B6F2B for ; Sun, 2 Aug 2009 00:59:33 +1000 (EST) Received: by ozlabs.org (Postfix) id C74E1DDDA2; Sun, 2 Aug 2009 00:59:33 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 3D03BDDD1B for ; Sun, 2 Aug 2009 00:59:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbZHAO70 (ORCPT ); Sat, 1 Aug 2009 10:59:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751642AbZHAO70 (ORCPT ); Sat, 1 Aug 2009 10:59:26 -0400 Received: from rtr.ca ([76.10.145.34]:37763 "EHLO mail.rtr.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbZHAO7Z (ORCPT ); Sat, 1 Aug 2009 10:59:25 -0400 Received: by mail.rtr.ca (Postfix, from userid 1002) id 9B28131DDB; Sat, 1 Aug 2009 10:59:25 -0400 (EDT) Received: from [10.0.0.6] (corey.localnet [10.0.0.6]) by mail.rtr.ca (Postfix) with ESMTP id 53CC731BA8; Sat, 1 Aug 2009 10:59:25 -0400 (EDT) Message-ID: <4A74584D.2010300@rtr.ca> Date: Sat, 01 Aug 2009 10:59:25 -0400 From: Mark Lord Organization: Real-Time Remedies Inc. User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Linux Kernel , linux-ext4@vger.kernel.org Subject: [PATCH] fs/compat_ioctl.c: add missing FS_IOC_FIEMAP support Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Add support for the FIEMAP ioctl for 32-bit user on 64-bit kernel. When using a 32-bit runtime on top of a 64-bit kernel, programs like "filefrag" and "hdparm --fibmap" do not work correctly. This is because there's no compat ioctl entry for the FIEMAP call. FIEMAP returns file extent info, similar to FIBMAP (but better). Since FIBMAP itself is b0rked on ext4, this leaves no way for a 32-bit program to reliably get detailed block information for a file when run on top of a 64-bit kernel. This patch addresses the issue. Once upstream, this patch could also be a candidate for -stable. Signed-off-by: Mark Lord --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- old/fs/compat_ioctl.c 2009-08-01 10:47:16.601066905 -0400 +++ linux/fs/compat_ioctl.c 2009-08-01 10:49:23.054387926 -0400 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1907,6 +1908,7 @@ COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */ /* 0x00 */ COMPATIBLE_IOCTL(FIBMAP) +COMPATIBLE_IOCTL(FS_IOC_FIEMAP) COMPATIBLE_IOCTL(FIGETBSZ) /* 'X' - originally XFS but some now in the VFS */ COMPATIBLE_IOCTL(FIFREEZE) @@ -2805,6 +2807,7 @@ goto out_fput; #endif + case FS_IOC_FIEMAP: case FIBMAP: case FIGETBSZ: case FIONREAD: