public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/2] tape/file_formats/blocked_reader: restore EOD behaviour
Date: Fri, 9 Apr 2021 17:54:37 +0200 (CEST)	[thread overview]
Message-ID: <1038366645.1985.1617983677776@webmail.proxmox.com> (raw)

IMHO this is the wrong fix.

Instead, we want to catch ENOSPC.

> On 04/09/2021 4:18 PM Dominik Csapak <d.csapak@proxmox.com> wrote:
> 
>  
> before commit
> 0db571249 ("tape: introduce BlockRead")
> 
> we did not return an error on EOD, but changed that.
> The rest of the code assumes to be able to read there and not
> encounter an error, so that change resulted in
> 
> 'no space left on device' errors on all tasks/api calls where we
> would read to the end of the tape, e.g. a restore, read label on an
> empty tape, etc.
> 
> This patch restores the previous behaviour.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> not sure if this is the intended behavior, but fixes many
> 'no space on device' errors we encounter currently
> 
> if the intention was that we catch the enospc error explicitely on the
> caller side, we would have to invent our own error type here,
> as this results in an io::Error with ErrorKind::Other (makes matching a bit weird)
> 
>  src/tape/file_formats/blocked_reader.rs | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/src/tape/file_formats/blocked_reader.rs b/src/tape/file_formats/blocked_reader.rs
> index 3df84a1b..e7dfa90a 100644
> --- a/src/tape/file_formats/blocked_reader.rs
> +++ b/src/tape/file_formats/blocked_reader.rs
> @@ -111,12 +111,9 @@ impl <R: BlockRead> BlockedReader<R> {
>                  }
>                  Ok(true)
>              }
> -            Ok(BlockReadStatus::EndOfFile) => {
> +            Ok(BlockReadStatus::EndOfFile) | Ok(BlockReadStatus::EndOfStream)=> {
>                  Ok(false)
>              }
> -            Ok(BlockReadStatus::EndOfStream) => {
> -                return Err(std::io::Error::from_raw_os_error(nix::errno::Errno::ENOSPC as i32));
> -            }
>              Err(err) => {
>                  Err(err)
>              }
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel




             reply	other threads:[~2021-04-09 15:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 15:54 Dietmar Maurer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-09 14:18 Dominik Csapak

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=1038366645.1985.1617983677776@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal