ext2: disallow setting xip on remount

Yan Zheng pointed out that ext2_remount lacks checking if -o xip should be
enabled or not. This patch checks for presence of direct_access on the
backing block device and if the blocksize meets the requirements.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Cc: Yan Zheng <yanzheng@21cn.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Carsten Otte and committed by Linus Torvalds 266f5aa0 4f84e4be

+8
+8
fs/ext2/super.c
··· 1038 1038 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | 1039 1039 ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); 1040 1040 1041 + ext2_xip_verify_sb(sb); /* see if bdev supports xip, unset 1042 + EXT2_MOUNT_XIP if not */ 1043 + 1044 + if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) { 1045 + printk("XIP: Unsupported blocksize\n"); 1046 + goto restore_opts; 1047 + } 1048 + 1041 1049 es = sbi->s_es; 1042 1050 if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) != 1043 1051 (old_mount_opt & EXT2_MOUNT_XIP)) &&