Writing problem with a block device driver

Writing problem with a block device driver

Post by Matthias Sattl » Fri, 17 Feb 1995 20:24:36



Hiho

I've got another problem with writing my block-device driver. The request
function gets the sector number wrong when I'm WRITING on the device, but
everything works fine whem I'm READING from the device.

The code looks like:

static void do_vd_request(void) {

        unsigned long sector;
.
.
.

repeat:
        INIT_REQUEST;

        sector = CURRENT->sector;
        printk("sector: %ld\n", sector);
.
.
.

The logging output for 'cat /dev/vd1' is:
...sector: 0
...sector: 2
...sector: 4
.
.
.
as it should be.

But for 'cat /dev/zero > /dev/vd1' I get:
...sector: 846
...sector: 848
...sector: 850
.
.
.

Hmmmm... looks strange. Does someone know what I'm doing wrong?

                                                Matthias

--

******************************************************************************
******************************************************************************

I am pleased to see that we have differences.  May we together become
greater than the sum of both of us.
           -- Surak of Vulcan, TOS: "The Savage Curtain", stardate 5906.4

******************************************************************************
******************************************************************************

Matthias Sattler

Phone: GERMANY 06333/65079 (always)
          "    06333/63175 (at reasonable times only)

And always remember:
                        When all else fails, read the instructions.