Re: [PATCH 15/37] libxfs: fix root inode handling inconsistencies

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

 



On Wed, Nov 06, 2013 at 12:07:01PM +1100, Dave Chinner wrote:
>  	mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev,
> -				LIBXFS_MOUNT_ROOTINOS | LIBXFS_MOUNT_DEBUGGER);
> +			  LIBXFS_MOUNT_DEBUGGER);
>  	if (!mp) {
> -		mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev,
> -				LIBXFS_MOUNT_DEBUGGER);
> -		if (!mp) {
> -			fprintf(stderr, _("%s: device %s unusable (not an XFS "
> -				"filesystem?)\n"), progname, fsdevice);
> -			exit(1);
> -		}
> +		fprintf(stderr,
> +			_("%s: device %s unusable (not an XFS filesystem?)\n"),
> +			progname, fsdevice);
> +		exit(1);
>  	}
>  	blkbb = 1 << mp->m_blkbb_log;
>  
> +	/*
> +	 * xfs_check needs corrected incore superblock values
> +	 */
> +	if (sbp->sb_rootino != NULLFSINO &&
> +	    xfs_sb_version_haslazysbcount(&mp->m_sb)) {
> +		int error = xfs_initialize_perag_data(mp, sbp->sb_agcount);
> +		if (error) {
> +			fprintf(stderr, _("%s: cannot init perag data (%d)\n"),
> +				progname, error);
> +			exit(EXIT_FAILURE);

The old code above just goes ahead without the perage data due to the
retry without LIBXFS_MOUNT_ROOTINOS.  I think we should keep that
behaviour as we want to be able to run xfs_db under as many
circumstances as possible.

Otherwise looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




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

  Powered by Linux