summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-18 06:53:31 +0000
committermav <mav@FreeBSD.org>2015-10-18 06:53:31 +0000
commit3143d6bb406e431c2b25ce67653158c6a0330706 (patch)
tree6a70812eb2fb5b56c87e3c3e07a66b691abf450c /sys/cam
parent69ff7e35391a34879a41e685d014fce4617fe3e8 (diff)
downloadFreeBSD-src-3143d6bb406e431c2b25ce67653158c6a0330706.zip
FreeBSD-src-3143d6bb406e431c2b25ce67653158c6a0330706.tar.gz
MFC r289136: Remove lock upgrade attempt from ctl_be_block_open_file().
I am not sure what for it was done. Now open routine should automatically fall back to read-only if open for writing is impossible. In such case attempt to upgrade to write sounds strange.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ctl/ctl_backend_block.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index eed451f..b8ff26b 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -1843,21 +1843,6 @@ ctl_be_block_open_file(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req)
return (error);
}
- /*
- * Verify that we have the ability to upgrade to exclusive
- * access on this file so we can trap errors at open instead
- * of reporting them during first access.
- */
- if (VOP_ISLOCKED(be_lun->vn) != LK_EXCLUSIVE) {
- vn_lock(be_lun->vn, LK_UPGRADE | LK_RETRY);
- if (be_lun->vn->v_iflag & VI_DOOMED) {
- error = EBADF;
- snprintf(req->error_str, sizeof(req->error_str),
- "error locking file %s", be_lun->dev_path);
- return (error);
- }
- }
-
file_data->cred = crhold(curthread->td_ucred);
if (params->lun_size_bytes != 0)
be_lun->size_bytes = params->lun_size_bytes;
OpenPOWER on IntegriCloud