dog vdi read recognize offset and len as 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sheepdog |
New
|
Undecided
|
Unassigned |
Bug Description
I found this behavior.
dog vdi read recognize offset and len as 0 when I read with too large offset and len.
Are these behaviors in test 2 & 4 are intended?
I think the both should return some error.
TEST:
-------
#!/bin/bash
BIND_ADDR=
MY_ADDR=
echo "starting services"
service corosync start
sheep -p 7000 /var/lib/sheepdog0 --bindaddr ${BIND_ADDR} --myaddr ${MY_ADDR} > /dev/null 3>&1
sheep -p 7001 /var/lib/sheepdog1 --bindaddr ${BIND_ADDR} --myaddr ${MY_ADDR} > /dev/null 3>&1
sheep -p 7002 /var/lib/sheepdog2 --bindaddr ${BIND_ADDR} --myaddr ${MY_ADDR} > /dev/null 3>&1
echo "started services"
echo "formating"
# dog cluster format -a ${BIND_ADDR} # remove for safety
echo "formatted"
echo "------
sheep -v
corosync -v
uname -a
echo "node list"
dog node list -a ${BIND_ADDR}
echo "vdi list(no VDI)"
dog vdi list -a ${BIND_ADDR}
echo "create test VDI"
dog vdi create test 10M -a ${BIND_ADDR}
echo "vdi list"
dog vdi list -a ${BIND_ADDR}
echo "write VDI(abcde)"
echo "abcde" | dog vdi write -a ${BIND_ADDR} test
echo "------check its content------"
echo "read with valid offest and len"
dog vdi read -a ${BIND_ADDR} test 0 5
echo "" # just for new line
echo "------test 1------"
echo "read with larger offset than VDI size(OK)"
echo -n "result :"
dog vdi read -a ${BIND_ADDR} test 100000000000000
echo "return code :"$?
echo "------test 2------"
echo "read with the offset that is larger than integer(?)."
echo "Result return head of the VDI.(The offset is recognized as 0?)"
echo -n "result :"
dog vdi read -a ${BIND_ADDR} test 100000000000000
echo "" # just for new line
dog vdi read -a ${BIND_ADDR} test 100000000000000
echo "return code :"$?
echo "------test 3------"
echo "read with the length that is larger than VDI size(may be OK)"
echo -n "result :"
dog vdi read -a ${BIND_ADDR} test 0 100000000000000
echo "return code :"$?
echo "------test 4------"
echo "read with the length that is lager than integer(?)."
echo "Result returns nothing.(The len is recognized as 0?)"
echo "result :"
dog vdi read -a ${BIND_ADDR} test 0 100000000000000
echo "return code :"$?
RESULT:
-------
starting services
Starting Corosync Cluster Engine (corosync): [ OK ]
started services
formating
using backend plain store
formatted
------environme
Sheepdog daemon version 0.7.7
Corosync Cluster Engine, version '1.4.1'
Copyright (c) 2006-2009 Red Hat, Inc.
Linux localhost.
node list
Id Host:Port V-Nodes Zone
0 192.168.
1 192.168.
2 192.168.
vdi list(no VDI)
Name Id Size Used Shared Creation time VDI id Copies Tag
create test VDI
vdi list
Name Id Size Used Shared Creation time VDI id Copies Tag
test 0 10 MB 0.0 MB 0.0 MB 2014-02-21 10:47 7c2b25 3
write VDI(abcde)
------check its content------
read with valid offest and len
abcde
------test 1------
read with larger offset than VDI size(OK)
result :Read offset is beyond the end of the VDI
return code :1
------test 2------
read with the offset that is larger than integer(?).
Result return head of the VDI.(The offset is recognized as 0?)
result :a
return code :0
------test 3------
read with the length that is larger than VDI size(may be OK)
result :abcde
return code :0
------test 4------
read with the length that is lager than integer(?).
Result returns nothing.(The len is recognized as 0?)
result : (no output)
return code :0