svn commit: r289136 - head/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Sun Oct 11 08:28:51 UTC 2015


Author: mav
Date: Sun Oct 11 08:28:49 2015
New Revision: 289136
URL: https://svnweb.freebsd.org/changeset/base/289136

Log:
  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

Modified:
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sun Oct 11 08:28:36 2015	(r289135)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sun Oct 11 08:28:49 2015	(r289136)
@@ -1840,21 +1840,6 @@ ctl_be_block_open_file(struct ctl_be_blo
 		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;


More information about the svn-src-all mailing list