xfs
[Top] [All Lists]

Re: [PATCH 2/7] Fix test whether kernel supports quotas

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/7] Fix test whether kernel supports quotas
From: Jan Kara <jack@xxxxxxx>
Date: Thu, 20 May 2010 14:49:02 +0200
Cc: Jan Kara <jack@xxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20100519184225.GA32747@xxxxxxxxxxxxx>
References: <1274276289-8839-1-git-send-email-jack@xxxxxxx> <1274276289-8839-3-git-send-email-jack@xxxxxxx> <20100519184225.GA32747@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Wed 19-05-10 14:42:25, Christoph Hellwig wrote:
> On Wed, May 19, 2010 at 03:38:04PM +0200, Jan Kara wrote:
> > For all 2.6 kernels presence of quota support in kernel can be detected by
> > checking /proc/sys/fs/quota. This is actually more reliable than trying to
> > mount a filesystem with quota options (for example because SCRATCH_DEV does
> > not have to contain a filesystem type we are going to test).
> 
> It's not actually correct.  /proc/sys/fs/quota only gets registered by
> fs/quota/dquot.c, which means it's not avaiable in a kernel that only
> has XFS quotas.
  Ah, I was convinced that _require_quota() should check whether VFS
quotas are enabled but apparently it should work also for XFS. So would
test like below be OK?

if [ $FSTYP = "xfs" ]; then
    [ -f /proc/fs/xfs/xqmstat ] || _notrun "Installed kernel does not support 
XFS quota"
else
    [ -d /proc/sys/fs/quota ] || _notrun "Installed kernel does not support 
quota"
fi

                                                                        Honza

-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR

<Prev in Thread] Current Thread [Next in Thread>