Re: put_write_access()

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 25 Jan 1999 00:28:17 +0000 (GMT)


> As far as I can see, put_write_access() is sometimes called when no
> corresponding get_write_access() has been called, causing i_writecount
> to go negative.
>
> As far as I can see, this is in no way dangerous, it's just annoying
> when debugging. I think it should be given a look, though.

Its potentially going to stop umounts, and file write accesses.

If you think this is the case, the following should find which device
the problem is on (untested)

--- fs/namei.c~ Sun Jan 24 20:30:39 1999
+++ fs/namei.c Sun Jan 24 23:30:04 1999
@@ -194,7 +194,11 @@

void put_write_access(struct inode * inode)
{
- inode->i_writecount--;
+ if(inode->i_writecount == 0)
+ printk(KERN_ERR "inode %p (%ld,%X), invalid write count!\n",
+ inode, inode->i_ino, inode->i_dev);
+ else
+ inode->i_writecount--;
}

/*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/