]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.17/0033-ext4-allow-defrag-EXT4_IOC_MOVE_EXT-in-32bit-compat-.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / 0033-ext4-allow-defrag-EXT4_IOC_MOVE_EXT-in-32bit-compat-.patch
CommitLineData
7d777456
GKH
1From 9a0bd6ee7ccc0cfdc614dbc6a4708d596ec53f82 Mon Sep 17 00:00:00 2001
2From: Christian Borntraeger <borntraeger@de.ibm.com>
3Date: Sun, 30 May 2010 22:49:47 -0400
4Subject: ext4: allow defrag (EXT4_IOC_MOVE_EXT) in 32bit compat mode
5
6commit b684b2ee9409f2890a8b3aea98525bbe5f84e276 upstream (as of v2.6.34-git13)
7
8I have an x86_64 kernel with i386 userspace. e4defrag fails on the
9EXT4_IOC_MOVE_EXT ioctl because it is not wired up for the compat
10case. It seems that struct move_extent is compat save, only types
11with fixed widths are used:
12{
13 __u32 reserved; /* should be zero */
14 __u32 donor_fd; /* donor file descriptor */
15 __u64 orig_start; /* logical start offset in block for orig */
16 __u64 donor_start; /* logical start offset in block for donor */
17 __u64 len; /* block length to be moved */
18 __u64 moved_len; /* moved block length */
19};
20
21Lets just wire up EXT4_IOC_MOVE_EXT for the compat case.
22
23Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
24Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
25Reviewed-by: Eric Sandeen <sandeen@redhat.com>
26CC: Akira Fujita <a-fujita@rs.jp.nec.com>
27Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
28---
29 fs/ext4/ioctl.c | 2 ++
30 1 file changed, 2 insertions(+)
31
32--- a/fs/ext4/ioctl.c
33+++ b/fs/ext4/ioctl.c
34@@ -375,6 +375,8 @@ long ext4_compat_ioctl(struct file *file
35 break;
36 case EXT4_IOC_GROUP_ADD:
37 break;
38+ case EXT4_IOC_MOVE_EXT:
39+ break;
40 default:
41 return -ENOIOCTLCMD;
42 }