Re: [PATCH 27/48] xfs_db: disable modification for CRC enabled filessytems.

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

 



On Fri, Jun 07, 2013 at 10:25:50AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> xfs_db does not have the IO infrastructure to calculate metadata
> CRCs after modifying metadata. Hence xfs_db can only run in
> read-only mode on filesystems with version 5 superblocks.
> 
> To fix this, xfs_db needs to have it's IO engine converted to use
> the buffer based IO provided by libxfs rather than rolling it's own
> IO routines. That is future work, so until this conversion is done,
> only allow xfs_db to run in read-only mode on v5 filesystems.
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>

Another one for the TODO list.

Reviewed-by: Ben Myers <bpm@xxxxxxx>

> ---
>  db/init.c |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/db/init.c b/db/init.c
> index 0e9e1a2..1033f3a 100644
> --- a/db/init.c
> +++ b/db/init.c
> @@ -132,6 +132,21 @@ init(
>  			exit(EXIT_FAILURE);
>  	}
>  
> +	/*
> +	 * Don't allow modifications to CRC enabled filesystems until we support
> +	 * CRC recalculation in the IO path. Unless, of course, the user is in
> +	 * the process of hitting us with a big hammer.
> +	 */
> +	if (XFS_SB_VERSION_NUM(sbp) >= XFS_SB_VERSION_5 &&
> +	    !(x.isreadonly & LIBXFS_ISREADONLY)) {
> +		fprintf(stderr, 
> +	_("%s: modifications to %s are not supported in thi version.\n"
							this

> +	"Use \"-r\" to run %s in read-only mode on this filesystem .\n"),
								  ^ extra space

> +			progname, fsdevice, progname);
> +		if (!force)
> +			exit(EXIT_FAILURE);
> +	}
> +
>  	mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev,
>  				LIBXFS_MOUNT_ROOTINOS | LIBXFS_MOUNT_DEBUGGER);
>  	if (!mp) {
> -- 
> 1.7.10.4
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
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