Patchwork [1/3] ext4: fix big-endian bug in extent migration code

login
register
mail settings
Submitter Theodore Ts'o
Date April 10, 2013, 4:02 a.m.
Message ID <1365566549-23325-1-git-send-email-tytso@mit.edu>
Download mbox | patch
Permalink /patch/235286/
State Accepted
Headers show

Comments

Theodore Ts'o - April 10, 2013, 4:02 a.m.
From: Dmitry Monakhov <dmonakhov@openvz.org>

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
---
 fs/ext4/extents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index c1c0094..fa85ce8 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4760,7 +4760,7 @@  int ext4_ind_migrate(struct inode *inode)
 	eh = ext_inode_hdr(inode);
 	ex  = EXT_FIRST_EXTENT(eh);
 	if (ext4_blocks_count(es) > EXT4_MAX_BLOCK_FILE_PHYS ||
-	    eh->eh_depth != 0 || eh->eh_entries > 1) {
+	    eh->eh_depth != 0 || le16_to_cpu(eh->eh_entries) > 1) {
 		ret = -EOPNOTSUPP;
 		goto errout;
 	}