Re: Linux 2.4.10-pre11

Alexander Viro (viro@math.psu.edu)
Thu, 20 Sep 2001 14:33:34 -0400 (EDT)


On Thu, 20 Sep 2001, Andrea Arcangeli wrote:

> > > + truncate_inode_pages(rd_inode[minor]->i_mapping, 0);
> > > rd_inode[minor] = NULL;
> > > rd_blocksizes[minor] = rd_blocksize;
> > > + unlock:
> > > up(&bdev->bd_sem);
> >
> > Now think what happens if you go through that code twice. What argument will
> > be passed to iput() the second time you call it?
>
> the second time we won't go through that code.

IOW, subsequent calls of ioctl(fd, BLKFLSBUF) will not work. Which is
better than oopsing, but doesn't look right.

Question: why the hell do we bother with iput() and decrementing counters
at all?

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