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

Add support for mark as write protected #654

Open
liulanzheng opened this issue Apr 9, 2021 · 3 comments
Open

Add support for mark as write protected #654

liulanzheng opened this issue Apr 9, 2021 · 3 comments

Comments

@liulanzheng
Copy link
Contributor

I need to mark a device write protected or not depending on what file is opened. But i didn't find an api to set the write protected bit in libtcmu.

@lxbsz
Copy link
Collaborator

lxbsz commented Apr 9, 2021

Yeah, it doesn't implement the SWP bit in the mode sense control page.

You can implement it in handle_control_page() if you want, which is similar to dev->write_cache_enabled.

@liulanzheng
Copy link
Contributor Author

@lxbsz Thanks for you advice, I implemented it and worked. But I am not quite familiar with iSCSI protocol and 'mode sense control page', I didn't find how to implement it in handle_control_page(). At last, I set the SWP bit in the 'DEVICE-SPECIFIC PARAMETER' field in the 'mode parameter header'. I am not sure whether it is correct even thong it worked.

@lxbsz
Copy link
Collaborator

lxbsz commented Apr 11, 2021

Yeah, set the wp bit in DEVICE-SPECIFIC PARAMETER should be enough.
For the spec, you can refer to https://origin-www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf

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

No branches or pull requests

2 participants