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

Introduce generic logsense issue I/F via EA #258

Merged
merged 2 commits into from
Mar 10, 2021
Merged

Introduce generic logsense issue I/F via EA #258

merged 2 commits into from
Mar 10, 2021

Conversation

piste-jp
Copy link
Member

Summary of changes

Introduce generic logselect issue I/F via EA by ltfs.vendor.IBM.logPage.XX.YY.

XX shall be a hex value like A0 as page code. YY XX shall be a hex value like 60 as subpage code.

Once LTFS receives a correct VEA, XX and YY can be converted by strroul() with base=16, LTFS always issues logsense to the drive and return the specified page by binary.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have confirmed my fix is effective or that my feature works

Atsushi Abe added 2 commits March 10, 2021 14:33
@piste-jp piste-jp self-assigned this Mar 10, 2021
@piste-jp piste-jp merged commit 5fb72dd into LinearTapeFileSystem:v2.4-stable Mar 10, 2021
@piste-jp piste-jp deleted the lp-sub branch March 10, 2021 12:31
piste-jp pushed a commit that referenced this pull request Mar 10, 2021
- Introduce generic logselect issue I/F via EA by ltfs.vendor.IBM.logPage.XX.YY
- XX shall be a hex value like A0 as page code. YY XX shall be a hex value like 60 as subpage code
- Once LTFS receives a correct VEA, XX and YY can be converted by strroul() with base=16, LTFS always issues logsense to the drive and return the specified page by binary
@piste-jp
Copy link
Member Author

Also merged to master.

ltfs_profiler_add_entry(priv->profiler, NULL, TAPEBEND_REQ_EXIT(REQ_TC_LOGSENSE));
return ret;

return logpage.len;

Choose a reason for hiding this comment

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

(this comment was added incorrectly onto pr 287, now moved to this pr)
Before this change, the ret value of lin_tape_ibmtape_logsense() is actually the ret code of ioctl SIOC_LOG_SENSE10_PAGE. With this change, the ret value was changed to length of data in buffer, which dooms to fail the check below in lin_tape_ibmtape_remaining_capacity(), even if the IOCTL is actually succeed.
We are hitting "LTFS30457I Cannot get remaining capacity: get log page 0x17 failed ..." error on an IBM tape autoloader. I think this is probably the root cause?

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks your review is correct. But I strongly recommend to use the sg backend not the lin_tape backend. Now we are leaving from lin_tape (from a few years ago) because we don't provide a good error handling on that. (I believe the sg backend doesn't have this issue.)

Could you open new PR for fixing this if you want to keep using the lin_tape backend? It need to be modified like beleow in all lines called in lin_tape_ibmtape_logsense()@lin_tape_ibmtape.c.

		/* Issue LogPage 0x31 */
		rc = lin_tape_ibmtape_logsense(device, LOG_TAPECAPACITY, (uint8_t)0, logdata, LOGSENSEPAGE);
		if (rc) {
			ltfsmsg(LTFS_INFO, 30457I, LOG_TAPECAPACITY, rc);
			ltfs_profiler_add_entry(priv->profiler, NULL, TAPEBEND_REQ_EXIT(REQ_TC_REMAINCAP));
			return rc;
		}

to

		/* Issue LogPage 0x31 */
		rc = lin_tape_ibmtape_logsense(device, LOG_TAPECAPACITY, (uint8_t)0, logdata, LOGSENSEPAGE);
		if (rc < 0) {
			ltfsmsg(LTFS_INFO, 30457I, LOG_TAPECAPACITY, rc);
			ltfs_profiler_add_entry(priv->profiler, NULL, TAPEBEND_REQ_EXIT(REQ_TC_REMAINCAP));
			return rc;
		}

@piste-jp piste-jp changed the title Introduce generic logselect issue I/F via EA Introduce generic logsense issue I/F via EA Sep 20, 2022
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.

2 participants