xfs
[Top] [All Lists]

Re: [PATCH RFC] xfs: run a filtered eofblocks scan on edquot/enospc

To: Ben Myers <bpm@xxxxxxx>
Subject: Re: [PATCH RFC] xfs: run a filtered eofblocks scan on edquot/enospc
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 22 Jan 2013 16:51:49 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130122185229.GS27055@xxxxxxx>
References: <1354913396-42206-1-git-send-email-bfoster@xxxxxxxxxx> <20130122185229.GS27055@xxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
On 01/22/2013 01:52 PM, Ben Myers wrote:
> Hey Brian,
> 
> On Fri, Dec 07, 2012 at 03:49:56PM -0500, Brian Foster wrote:
...
>>      /*
>> +     * A quota failure can be represented as EDQUOT or ENOSPC in the case
>> +     * of project quotas. Check the quotas explicitly for low space
>> +     * conditions, run a prealloc scan if warranted and retry. Otherwise,
>> +     * proceed to general ENOSPC handling.
>> +     */
>> +    if ((ret == -EDQUOT || ret == -ENOSPC) && !edquot) {
>> +            edquot = 1;
>> +            if (xfs_inode_free_quota_eofblocks(ip))
>> +                    goto write_retry;
>> +    }
> 
> It looks like you have the iolock held across this call to free eofblocks.  Is
> it possible that this inode would already have some eofblocks, be tagged on 
> the
> radix tree, and you'd try to get the lock a second time?
> 

Yeah, we're doing a SYNC_WAIT eofblocks scan here so it does seem to be
a possibility. It looks like I should drop and reacquire the lock around
the xfs_inode_free_quota_eofblocks() call.

> I think you're right about XFS_IS_*QUOTA_ENFORCED.  
> 
> Neat patch!  I wish we had a solid way to know which quota was enforced at 
> this
> level.  Still, this is much better than trimming eofblocks on all inodes.
> 

Thanks for reviewing. I agree on the quota bit, I figured this approach
would be more appropriate than burying it in the reservation code, since
the alternative is an error back to userspace. I'll plan to add the
flush bits and polish this up.

Brian

> -Ben
> 

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