From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbZHCRsS (ORCPT ); Mon, 3 Aug 2009 13:48:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752665AbZHCRsR (ORCPT ); Mon, 3 Aug 2009 13:48:17 -0400 Received: from rtr.ca ([76.10.145.34]:50993 "EHLO mail.rtr.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971AbZHCRsQ (ORCPT ); Mon, 3 Aug 2009 13:48:16 -0400 Message-ID: <4A7722DF.80704@rtr.ca> Date: Mon, 03 Aug 2009 13:48:15 -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 Cc: Eric Sandeen , Andrew Morton Subject: Re: [PATCH] fs/compat_ioctl.c: add missing FS_IOC_FIEMAP support References: <4A74584D.2010300@rtr.ca> In-Reply-To: <4A74584D.2010300@rtr.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (resending, no ack from anyone first time around). 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 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 --- 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: