Skip to content

fix: Handle IO transient errors - #652

Open
madjesc wants to merge 10 commits into
LinearTapeFileSystem:release/v2.4.9.1from
madjesc:fix/write-soft-err
Open

madjesc wants to merge 10 commits into
LinearTapeFileSystem:release/v2.4.9.1from
madjesc:fix/write-soft-err

Conversation

@madjesc

@madjesc madjesc commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Issue description

When writting data to a tape, at random moments, a Power-On-Reset (POR) event could occurs, which would stop the operation and make the write fail, affecting the user experience.

This PR fixes this issue by performing a retry when a POR is detected. This retry will be performed at most 3 times and in different timelapses, giving time the hardware to be ready to continue.

fix: Fixing compilation

fix: Retrying write operations only after repositioning the drive
@madjesc
madjesc requested review from XV02 and syaoraang and removed request for syaoraang October 2, 2026 20:45
@syaoraang
syaoraang requested a review from Rolaxgar97 October 2, 2026 21:05

@syaoraang syaoraang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go!

@Rolaxgar97 Rolaxgar97 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@XV02 XV02 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for the rest of the changes still pending as we discussed

mcardenas and others added 8 commits October 6, 2026 15:56
- clear the previous power on reset status and retry
- retry in both ibmtape netbsd driver and the sg one
- make _clear_por return an int

fix: minor changes

chore: revert separation of por and allocation issues

feat: make block failure generic
fix: Avoiding hidding cdb_write return code

fix: Using correct return value to check write output
fix: Attending Missael's requests

fix: Attending Missael's requests

fix: write soft error handling (POR and transport failures)

Fix: start_block misalignment caused by SIGSTOP (LinearTapeFileSystem#552)

fix: start_block misalignment caused by position mismatch  LinearTapeFileSystem#11

fix: Fixing compilation

fix: Fixing compilation

chore: Attending Japan team comments
* Handling better the return code that was forcefully set as DEVICE_GOOD
* Renaming _handle_block_write_failure() to _resolve_position_after_io_cmd_failure() to reduce naming concerns and yet don't repeat code. We don't take inconsideration the EDEV_BUFFER_ALLOCATE_ERROR when called by -EDEV_HOST_ERROR since it doesn't affect that path.

fix: Avoiding shadowing the _cdb_write() return value if _clear_por() return value is not DEVICE_GOOD.
Fixing in scsipi_ibmtape.c file an issue where the ret_write wasn't changed never but returned anyways.

chore: Adding log to mention the retry due the POR

chore: Attending Japan team comments on POR issue PR
Implement dylan suggestion

Co-authored-by: DYLAN CARLSON <dcarlso@us.ibm.com>
fix: write soft error handling (POR and transport failures)
chore: make readability better

Implement dylan suggestion

Co-authored-by: DYLAN CARLSON <dcarlso@us.ibm.com>

fix: readibility

fix: write soft error handling (POR and transport failures)

fix: set SP bit

fix: add read retry
@madjesc
madjesc force-pushed the fix/write-soft-err branch 4 times, most recently from 9cebb06 to b3b9049 Compare October 7, 2026 18:19
@madjesc
madjesc force-pushed the fix/write-soft-err branch from b3b9049 to 7ee5419 Compare October 7, 2026 18:19
* specific mode page
* Right now SDE and LE does not set any non savable pages, but this could change.
* */
cdb[1] = 0x11;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madjesc I believe it would be helpful to write a short comment about why we are enabling SP bit now

cdb[1] = 0x10; /* Set PF bit */
/*
* Set PF and SP bit
* NOTE: Not all modepages support SP bit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, it is affecting all modes pages, I think it would be useful to only enable SPI bit for READ_WRITE_CTRL page, which is the one that include Append-Only Mode (AOM) and Allow Overwitte modes as we talked.

Additionally, you already have a list of the modepages used by LTFS, where I think SP is supported, so this comment is a bit misleading, could you check it and add that mode pages list in the PR description?

@amissael95 amissael95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, if possible just address the comments to make these changes and PR more descriptive.

@XV02 XV02 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work on this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants