[PATCH 1/4] xfs: Teach dquot recovery about CONFIG_XFS_QUOTA

Ben Myers bpm at sgi.com
Tue Apr 30 13:22:03 CDT 2013


On Tue, Apr 30, 2013 at 09:39:33PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
> 
> Fix a build error when CONFIG_XFS_QUOTA=n:
> 
> fs/built-in.o: In function `xlog_recovery_validate_buf_type':
> /home/dave/src/build/x86-64/xfsdev/fs/xfs/xfs_log_recover.c:1948: undefined
> reference to `xfs_dquot_buf_ops'
> 
> Reported-by: Michael L. Semon <mlsemon35 at gmail.com>
> Signed-off-by: Dave Chinner <dchinner at redhat.com>

Applied fine this time.  Must have been a PEBKAC.

Reviewed-by: Ben Myers <bpm at sgi.com>



> ---
>  fs/xfs/xfs_log_recover.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 35ac504..ecaa4d4 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -1940,12 +1940,18 @@ xlog_recovery_validate_buf_type(
>  	case XFS_BLFT_UDQUOT_BUF:
>  	case XFS_BLFT_PDQUOT_BUF:
>  	case XFS_BLFT_GDQUOT_BUF:
> +#ifdef CONFIG_XFS_QUOTA
>  		if (magic16 != XFS_DQUOT_MAGIC) {
>  			xfs_warn(mp, "Bad DQUOT block magic!");
>  			ASSERT(0);
>  			break;
>  		}
>  		bp->b_ops = &xfs_dquot_buf_ops;
> +#else
> +		xfs_alert(mp,
> +	"Trying to recover dquots without QUOTA support built in!");
> +		ASSERT(0);

Maybe it makes sense for recovery to fail in that case.

-Ben



More information about the xfs mailing list