lkml.org 
[lkml]   [2014]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 12/22] ext2: Remove ext2_xip_verify_sb()
On Wed, Apr 09, 2014 at 11:52:54AM +0200, Jan Kara wrote:
> > - if ((sbi->s_mount_opt ^ old_mount_opt) & EXT2_MOUNT_XIP) {
> > + if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_XIP) {
> > ext2_msg(sb, KERN_WARNING, "warning: refusing change of "
> > "xip flag with busy inodes while remounting");
> > - sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
> > - sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP;
> > + sbi->s_mount_opt ^= EXT2_MOUNT_XIP;
> Although this is correct, it was easier to see that the previous code is
> correct so I'd prefer if you kept it that way.

Depends how you think about it. I think of foo ^= bar as 'toggle the
bar bit in foo'. So I read the code as 'If the mount bit is incorrect,
print an error and toggle the bit'. I think you're reading the old code
as 'If the new mount bit differs from the old mount bit, make sure the
new mount bit is the same as the old mount bit'.


\
 
 \ /
  Last update: 2014-04-10 16:41    [W:0.083 / U:4.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site