Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Oct 2015 06:53:31 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r289489 - stable/10/sys/cam/ctl
Message-ID:  <201510180653.t9I6rVdH058208@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Oct 18 06:53:31 2015
New Revision: 289489
URL: https://svnweb.freebsd.org/changeset/base/289489

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

Modified:
  stable/10/sys/cam/ctl/ctl_backend_block.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_backend_block.c	Sun Oct 18 05:51:44 2015	(r289488)
+++ stable/10/sys/cam/ctl/ctl_backend_block.c	Sun Oct 18 06:53:31 2015	(r289489)
@@ -1843,21 +1843,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510180653.t9I6rVdH058208>