Patchwork [01/25] libext2: Fix EXT2_LIB_SOFTSUPP masking

login
register
mail settings
Submitter Eric Sandeen
Date Sept. 16, 2011, 8:49 p.m.
Message ID <1316206180-6375-2-git-send-email-sandeen@redhat.com>
Download mbox | patch
Permalink /patch/115032/
State Accepted
Headers show

Comments

Eric Sandeen - Sept. 16, 2011, 8:49 p.m.
EXT2_LIB_SOFTSUPP_INCOMPAT_* are supposed to be bitmasks
of features which can be opened even though they are
under development.  The intent is that these are masked
out of the features list, so that they will be ignored
on open.

However, the code does a logical not vs. a bitwise not:

	features &= !EXT2_LIB_SOFTSUPP_INCOMPAT;

which will not have the desired effect...

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 lib/ext2fs/openfs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Theodore Ts'o - Sept. 16, 2011, 10:52 p.m.
On Fri, Sep 16, 2011 at 03:49:16PM -0500, Eric Sandeen wrote:
> EXT2_LIB_SOFTSUPP_INCOMPAT_* are supposed to be bitmasks
> of features which can be opened even though they are
> under development.  The intent is that these are masked
> out of the features list, so that they will be ignored
> on open.
> 
> However, the code does a logical not vs. a bitwise not:
> 
> 	features &= !EXT2_LIB_SOFTSUPP_INCOMPAT;
> 
> which will not have the desired effect...
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Applied, thanks.

						- Ted
--
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

Patch

diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index b13db77..0b4df38 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -214,7 +214,7 @@  errcode_t ext2fs_open2(const char *name, const char *io_options,
 		features = fs->super->s_feature_incompat;
 #ifdef EXT2_LIB_SOFTSUPP_INCOMPAT
 		if (flags & EXT2_FLAG_SOFTSUPP_FEATURES)
-			features &= !EXT2_LIB_SOFTSUPP_INCOMPAT;
+			features &= ~EXT2_LIB_SOFTSUPP_INCOMPAT;
 #endif
 		if (features & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP) {
 			retval = EXT2_ET_UNSUPP_FEATURE;
@@ -224,7 +224,7 @@  errcode_t ext2fs_open2(const char *name, const char *io_options,
 		features = fs->super->s_feature_ro_compat;
 #ifdef EXT2_LIB_SOFTSUPP_RO_COMPAT
 		if (flags & EXT2_FLAG_SOFTSUPP_FEATURES)
-			features &= !EXT2_LIB_SOFTSUPP_RO_COMPAT;
+			features &= ~EXT2_LIB_SOFTSUPP_RO_COMPAT;
 #endif
 		if ((flags & EXT2_FLAG_RW) &&
 		    (features & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP)) {