* [PATCH][RESEND] Reporting wrong status for non-existant files
@ 2006-10-25 13:18 Glauber de Oliveira Costa
2006-11-01 11:57 ` Glauber de Oliveira Costa
0 siblings, 1 reply; 2+ messages in thread
From: Glauber de Oliveira Costa @ 2006-10-25 13:18 UTC (permalink / raw)
To: xen-devel, ewan
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
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@redhat.com>
--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
[-- Attachment #2: filenotfound.patch --]
[-- Type: text/plain, Size: 883 bytes --]
# 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 \
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH][RESEND] Reporting wrong status for non-existant files
2006-10-25 13:18 [PATCH][RESEND] Reporting wrong status for non-existant files Glauber de Oliveira Costa
@ 2006-11-01 11:57 ` Glauber de Oliveira Costa
0 siblings, 0 replies; 2+ messages in thread
From: Glauber de Oliveira Costa @ 2006-11-01 11:57 UTC (permalink / raw)
To: Glauber de Oliveira Costa; +Cc: xen-devel, ewan
any comments here?
On 10/25/06, Glauber de Oliveira Costa <gcosta@redhat.com> 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@redhat.com>
>
> --
> Glauber de Oliveira Costa
> Red Hat Inc.
> "Free as in Freedom"
>
>
> # 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 \
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-01 11:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 13:18 [PATCH][RESEND] Reporting wrong status for non-existant files Glauber de Oliveira Costa
2006-11-01 11:57 ` Glauber de Oliveira Costa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.