lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140410183526.GB8060@quack.suse.cz>
Date:	Thu, 10 Apr 2014 20:35:26 +0200
From:	Jan Kara <jack@...e.cz>
To:	Matthew Wilcox <willy@...ux.intel.com>
Cc:	Jan Kara <jack@...e.cz>,
	Matthew Wilcox <matthew.r.wilcox@...el.com>,
	linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 12/22] ext2: Remove ext2_xip_verify_sb()

On Thu 10-04-14 10:22:54, Matthew Wilcox wrote:
> 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'.
  Yeah, since it's pretty obvious what the code should do, one can figure
out it is correct relatively quickly. But it's something that wasn't
obvious to me at the first sight. If you really prefer your way, I can live
with that...

								Honza
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ