Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct ltfs_check_medium handling of partitions ending in data+fm #302

Merged
merged 3 commits into from
Sep 6, 2021

Conversation

linnemannr
Copy link
Contributor

Alter ltfs_check_medium to do a more thorough detection of the state of
the partitions after the detected indices and set the eod/append
position appropriately if the partition ends in data + filemark

Fixes #272

@piste-jp piste-jp self-assigned this Jul 26, 2021
Copy link
Member

@piste-jp piste-jp left a comment

Choose a reason for hiding this comment

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

Sorry for my slow response. We have serial holidays in Japan.

Could you consider my comments?

src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
src/libltfs/ltfs_internal.c Show resolved Hide resolved
src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
Alter ltfs_check_medium to do a more thorough detection of the state of
the partitions after the detected indices and set the eod/append
position appropriately if the partition ends in data + filemark

Fixes LinearTapeFileSystem#272
@linnemannr
Copy link
Contributor Author

Sorry for my slow response. We have serial holidays in Japan.

Could you consider my comments?

I think I've addressed your comments, please check the revised code and let me know what you think.

Thanks!

Copy link
Member

@piste-jp piste-jp left a comment

Choose a reason for hiding this comment

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

I think you are almost there. But please take a look my 2 comments.

src/libltfs/ltfs_internal.c Show resolved Hide resolved
src/libltfs/ltfs_internal.c Outdated Show resolved Hide resolved
Change parameter list to include vol and partid instead of device and part
number and emit 11020E or 11023E on tape_seek failure as appropriate for the
given partid
Copy link
Member

@piste-jp piste-jp left a comment

Choose a reason for hiding this comment

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

I would like to request the 2 changes on our conversation.

  1. Capture the EOD position around line 1020 @ ltfs_internal.c
  2. Change the condition of line 1024 @ ltfs_internal.c. From (n_fm_after == 2 ) to (n_fm_after == 2 && eod_pos == final_fm_pos + 1)

If a partition ends in in a potential partial index after the known consistent
index on that partition, only truncate it if the parameter 'fix' is true in
ltfs_check_medium()
Copy link
Member

@piste-jp piste-jp left a comment

Choose a reason for hiding this comment

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

Looks great to me

@piste-jp
Copy link
Member

piste-jp commented Sep 6, 2021

Thanks, it looks great to me.

@piste-jp piste-jp merged commit 33dbad1 into LinearTapeFileSystem:master Sep 6, 2021
@linnemannr
Copy link
Contributor Author

Excellent! Thank you for accepting my PR!

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.

Recovery of volume with trailing data and file mark on data partition breaks index traversal
2 participants