[PATCH] ubifs: return ENOSPC if running out of inode number

Sheng Yong shengyong1 at huawei.com
Tue Feb 7 02:05:43 PST 2017



On 2/7/2017 5:25 PM, Richard Weinberger wrote:
> Sheng Yong,
> 
> Am 07.02.2017 um 09:19 schrieb Sheng Yong:
>>> Can you please explain *why* this has to be changed to -ENOSPC?
>> Hi, Richard,
>>
>> This is a trivial change. I think if there is not enough inode number available,
>> it means the filesystem has no room for the new file. So ENOSPC may be appropriate,
>> and some others filesystems returns ENOSPC in such scenario :)
> 
> It is less trivial than you might think.
> UBIFS cannot reuse inode numbers, as soon you reach INUM_WATERMARK
> the filesystem is more or less dead. -ENOSPC indicates that the user
> can produce free space by deleting files, which will *not* help.
> That's why we use -EINVAL in terms of "we are in bad state". :)
Right. This makes sense :)
> 
> Unless you can show me an actual breakage because of -EINVAL instead
> of -ENOSPC I'd keep it as-is.
> Did you hit that code path? It is more likely to wear out the flash
> long before you hit that limit.
No I didn't hit this. The watermark is large enough.

thanks,
Sheng
> 
> Thanks,
> //richard
> 
> .
> 




More information about the linux-mtd mailing list