Re: [PATCH 2/2] btrfs: Validate btrfs_super_block::log_root_transid

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

 



On Thu, Oct 04, 2018 at 09:57:22AM +0300, Nikolay Borisov wrote:
> > +	/*
> > +	 * Check log root transid against super block generation.
> > +	 *
> > +	 * Older kernel doesn't populate log_root_transid, only need to check
> > +	 * it when it's not zero.
> > +	 * Since replaying suspicious log tree can cause serious problem, refuse
> > +	 * to mount if it doesn't match.
> > +	 */
> > +	if (btrfs_super_log_root_transid(sb) &&
> > +	    btrfs_super_log_root_transid(sb) != generation + 1) {
> 
> nit: in the same vein as you do for btrfs_super_generation just assign
> super_log_root_Transid to a local var and use that. IMO it's more
> consistent with what's happening in this function.

While I see your point I think the way Qu did it is also fine, there's
not much duplication and I find it readable.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux