WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][RESEND] Reporting wrong status for non-existant

To: "Glauber de Oliveira Costa" <gcosta@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][RESEND] Reporting wrong status for non-existant files
From: "Glauber de Oliveira Costa" <glommer@xxxxxxxxx>
Date: Wed, 1 Nov 2006 08:57:00 -0300
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, ewan@xxxxxxxxxxxxx
Delivery-date: Thu, 02 Nov 2006 13:51:01 -0800
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VmfaTNEujRxFg+NYXMIwE30TIJJt3+iA/gZlUQd+0JbzT2AXjxdaVbBSTT/rLzZUG7Y87WKhIQJ4oqfBvQnV1FefgMA/I8BHgcMeQlENWgFH8uXrIM0jYlRpZ6JEqm6rVsjP7CAkW6/KbYPfCqQLScaLPE79ITAWXQNFaSvnQnc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20061025131852.GA16944@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20061025131852.GA16944@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
any comments here?

On 10/25/06, Glauber de Oliveira Costa <gcosta@xxxxxxxxxx> wrote:
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".

Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>

--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"


# HG changeset patch
# User root@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# 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 \


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel





--
Glauber de Oliveira Costa.
"Free as in Freedom"

Add your comments to GPLv3 at:
http://gplv3.fsf.org/comments/gplv3-draft-2.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] [PATCH][RESEND] Reporting wrong status for non-existant files, Glauber de Oliveira Costa <=