tape capacity overflow after a space error

GNU General Public License Linux disk based Virtual Tape Library
Developed by Mark Harvey - markh794@gmail.com
To get started, go to: http://sites.google.com/site/linuxvtl2/

tape capacity overflow after a space error

Postby kamy » Wed Apr 14, 2010 12:30 pm

I wrote only 1 tape file on a tape, then rewind, then FSF 2... A error is returned, and that's ok !

but the remaining capacity becomes 4095 MiB ( the media is only 16MiB ) after that !

I think some tests are missing, for the position erroneously greater than the current maximum size of media.
kamy
Registered
 
Posts: 6
Joined: Wed Apr 14, 2010 12:23 pm

Re: tape capacity overflow after a space error

Postby admin » Wed Apr 14, 2010 7:05 pm

Thank you. I have sent this to the Developers.
User avatar
admin
Forum Site Admin
 
Posts: 5
Joined: Sat Dec 12, 2009 1:44 am

Re: tape capacity overflow after a space error

Postby markh794 » Fri Apr 30, 2010 12:34 am

I've attempted to reproduce this (unsuccessfully).
What version are you using ? 0.16 vs 0.18 ? Are you running on 32 or 64bit ?
Have you tried using the 'dump_tape -f <barcode>' - One of the first lines will be the 'capacity' limit of this media.
markh794
MHVTL - Developer
 
Posts: 84
Joined: Sat Feb 20, 2010 6:30 pm
Location: Sydney, Australia

Re: tape capacity overflow after a space error

Postby kamy » Fri May 28, 2010 12:06 pm

Still there in the last stable 0.16.13

I make a tape of 64MB, fill it with "dd" linux command in one pass.
from a C binary, I do "rewind" + "fsf 2" which fails (that's normal), but then, when I ask remaining space , I get 4 GB.

So I think this issue is still there.
This is my patch ... but please verify, it may be hiding a more subtle bug.

Code: Select all
--- mhvtl/usr/vtltape.c   (revision 10218)
+++ mhvtl/usr/vtltape.c   (revision 13864)
@@ -943,15 +943,19 @@
      MHVTL_DBG(1, "LOG SENSE: Tape Capacity page");
      TapeCapacity.pcode_head.len = htons(sizeof(TapeCapacity) -
               sizeof(TapeCapacity.pcode_head));
-      if (tapeLoaded == TAPE_LOADED) {
-         TapeCapacity.value01 =
-            htonl(max_tape_capacity - c_pos.curr_blk);
-         TapeCapacity.value03 = htonl(max_tape_capacity);
-      } else {
-         TapeCapacity.value01 = 0;
-         TapeCapacity.value03 = 0;
-      }
-      b = memcpy(b, &TapeCapacity, sizeof(TapeCapacity));
+                TapeCapacity.value01 = 0;
+                TapeCapacity.value03 = 0;
+
+                if (tapeLoaded == TAPE_LOADED) {
+
+                    TapeCapacity.value03 = htonl(max_tape_capacity);
+
+                    if (c_pos.curr_blk <= max_tape_capacity)  {
+                        TapeCapacity.value01 =
+                        htonl(max_tape_capacity - c_pos.curr_blk);
+                    }
+                }
+                b = memcpy(b, &TapeCapacity, sizeof(TapeCapacity));
      retval += sizeof(TapeCapacity);
      break;
   case DATA_COMPRESSION:   /* Data Compression page */
kamy
Registered
 
Posts: 6
Joined: Wed Apr 14, 2010 12:23 pm

Re: tape capacity overflow after a space error

Postby markh794 » Mon May 31, 2010 8:44 pm

Thanks..

I'm a little tied up today, but should be able to confirm tomorrow (2nd Jun).

There is also another bug where sending a REQUEST SENSE causes the daemon to core dump.

I'll be merging these and will submit a new package once some testing has been done.

Cheers
Mark
markh794
MHVTL - Developer
 
Posts: 84
Joined: Sat Feb 20, 2010 6:30 pm
Location: Sydney, Australia


Return to MHVTL Discussion Forums

Who is online

Users browsing this forum: d_y19, rami766, root and 0 guests