public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] tape/file_formats/blocked_reader: restore EOD behaviour
Date: Fri,  9 Apr 2021 16:18:03 +0200	[thread overview]
Message-ID: <20210409141804.2496-1-d.csapak@proxmox.com> (raw)

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





             reply	other threads:[~2021-04-09 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 14:18 Dominik Csapak [this message]
2021-04-09 14:18 ` [pbs-devel] [PATCH proxmox-backup 2/2] api2/tape/backup: commit pool even after an error Dominik Csapak
2021-04-09 15:54 [pbs-devel] [PATCH proxmox-backup 1/2] tape/file_formats/blocked_reader: restore EOD behaviour Dietmar Maurer

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=20210409141804.2496-1-d.csapak@proxmox.com \
    --to=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