All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yong <shengyong1@huawei.com>
To: Richard Weinberger <richard@nod.at>,
	<linux-mtd@lists.infradead.org>, <dedekind1@gmail.com>
Subject: Re: [PATCH] ubifs: return ENOSPC if running out of inode number
Date: Tue, 7 Feb 2017 18:05:43 +0800	[thread overview]
Message-ID: <58999BF7.1040708@huawei.com> (raw)
In-Reply-To: <4e5ef150-a766-c9a9-5503-a30fd16a295d@nod.at>



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
> 
> .
> 

      reply	other threads:[~2017-02-07 10:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  7:28 [PATCH] ubifs: return ENOSPC if running out of inode number Sheng Yong
2017-02-07  7:57 ` Richard Weinberger
2017-02-07  8:19   ` Sheng Yong
2017-02-07  9:25     ` Richard Weinberger
2017-02-07 10:05       ` Sheng Yong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58999BF7.1040708@huawei.com \
    --to=shengyong1@huawei.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.