mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH master] fs: align truncate return codes with POSIX
Date: Thu, 2 Feb 2023 14:12:16 +0100	[thread overview]
Message-ID: <20230202131216.dyebwhxmqwvz3qhi@pengutronix.de> (raw)
In-Reply-To: <20230202122000.195253-1-a.fatoum@pengutronix.de>

Hi Ahmad,

thanks for the patch.

On 23-02-02, Ahmad Fatoum wrote:
> Writing past end of a file results in a cryptic error code:
> 
>   barebox@board:/ cp /dev/zero /dev/mmc0.part
>   write: Operation not permitted
>   cp: Operation not permitted
> 
> Because the cdev's truncate is not implemented and as such partition
> can't be increased in size. POSIX specifies EPERM as the correct return
> code for truncate(2) in such a situation, but for write(2) it is ENOSPC.
> Thus most truncate callbacks in barebox instead return ENOSPC, when
> according to POSIX, EPERM would have been the correct error code to
> propagate.
> 
> Switching all truncate drivers is a bit more involved, so for now let's
> treat EPERM and ENOSPC instead when truncate fails to enlarge a file.
> 
> Reported-by: Marco Felsch <m.felsch@pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>



  reply	other threads:[~2023-02-02 13:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 12:20 Ahmad Fatoum
2023-02-02 13:12 ` Marco Felsch [this message]
2023-02-03  7:52 ` Sascha Hauer

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=20230202131216.dyebwhxmqwvz3qhi@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox