Re: [PATCH 5/6] ext4: Drop i_state_flags on architectures with 64-bit longs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-01-04, at 18:01, Theodore Ts'o wrote:
> +#if (BITS_PER_LONG < 64)
> +EXT4_INODE_BIT_FNS(state, state_flags, 0)
> +#define EXT4_CLEAR_STATE_FLAGS(ei)	(ei)->i_state_flags = 0
> +#else
> +EXT4_INODE_BIT_FNS(state, flags, 32)
> +#define EXT4_CLEAR_STATE_FLAGS(ei)	(ei)->i_flags = 0

This looks like it will clear all of the i_flags values, instead of just the
state flags.  It should probably be something like:

#define EXT4_CLEAR_STATE_FLAGS(ei)	(ei)->i_flags &= 0xffffffffULL;

> @@ -1009,6 +1009,7 @@ got:
> 	 * extent flag on newly created directory and file only if -o extent
> 	 * mount option is specified
> 	 */
> +	EXT4_CLEAR_STATE_FLAGS(ei);
> 	ei->i_flags =
> 		ext4_mask_flags(mode, EXT4_I(dir)->i_flags & EXT4_FL_INHERITED);
> 	ei->i_file_acl = 0;
> @@ -1027,7 +1028,6 @@ got:
> 	inode->i_generation = sbi->s_next_generation++;
> 	spin_unlock(&sbi->s_next_gen_lock);
> 
> -	ei->i_state_flags = 0;

It looks like you have compensated for the above by changing the
code here, but I think it is risky/confusing if clearing the state
flags has a side-effect on 64-bit arches, that doesn't exist on
32-bit arches.  It looks like a bug waiting to happen...

Cheers, Andreas





--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux