From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber de Oliveira Costa Subject: [PATCH] Reporting wrong status for non-existant files Date: Mon, 23 Oct 2006 16:45:16 -0300 Message-ID: <20061023194516.GD14072@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DrWhICOqskFTAXiy" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --DrWhICOqskFTAXiy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, The block scripts under tools/examples is not reporting the proper information in the event of a non-exitent file being passed on, like in "file:/nonexistant,hda,w". Thanks, -- Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom" --DrWhICOqskFTAXiy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="filenotfound.patch" # HG changeset patch # User root@et-virt07.lab.boston.redhat.com # Date 1161631865 14400 # Node ID 6b28d144c5814b5206592e93bcea4b7d0a752e8a # Parent 29b02d929b7e4df6016c16ebba71d6d73462882e The block script is reporting the file as non-writable, even if it does not exists diff -r 29b02d929b7e -r 6b28d144c581 tools/examples/block --- a/tools/examples/block Mon Oct 23 14:42:52 2006 +0100 +++ b/tools/examples/block Mon Oct 23 15:31:05 2006 -0400 @@ -266,7 +266,15 @@ case "$command" in claim_lock "block" - if [ "$mode" == 'w' ] && ! stat "$file" -c %A | grep -q w + fstat=$(stat "$file" -c %A) + if [ "$?" == '1' ]; + then + release_lock "block" + ebusy \ +"File $file not found." + fi + + if [ "$mode" == 'w' ] && ! echo $fstat | grep -q w then release_lock "block" ebusy \ --DrWhICOqskFTAXiy Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --DrWhICOqskFTAXiy--