diff options
author | Alexander Motin <mav@FreeBSD.org> | 2015-10-11 08:28:49 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2015-10-11 08:28:49 +0000 |
commit | 361e885315791413a9448e21de8bb3395dfa6515 (patch) | |
tree | d1741e8c1f0b6ddecd452926d8f498b44d1b3fa0 | |
parent | fc28939612b571d6e303e158d7a1aebab3f0985a (diff) | |
download | src-361e885315791413a9448e21de8bb3395dfa6515.tar.gz src-361e885315791413a9448e21de8bb3395dfa6515.zip |
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.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=289136
-rw-r--r-- | sys/cam/ctl/ctl_backend_block.c | 15 |
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 2930fbd66285..254f52bbc3b0 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -1840,21 +1840,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; |