Re: ramfs problem... (unlink of sparse file in "D" state)

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Jan 08 2001 - 12:35:17 EST


On Mon, 8 Jan 2001, Chris Mason wrote:

>
> On Monday, January 08, 2001 10:47:41 AM -0500 Alexander Viro
> <viro@math.psu.edu> wrote:
> > + do {
> > + if (buffer_mapped(bh)) {
> > + bh->b_end_io = end_buffer_io_async;
> > + atomic_inc(&bh->b_count);
> > + set_bit(BH_Uptodate, &bh->b_state);
> > + set_bit(BH_Dirty, &bh->b_state);
> ^^^^^^^
>
> Sorry, missed this the first time I read it. We need to clear the dirty bit
> before sending to submit_bh, otherwise it stays dirty until
> try_to_free_buffers writes it again.

Umm... It does recovery, but we do extra write on blocks we've managed to
allocate. Thanks for spotting - looks like a bug that had been in the patch
for a month or so ;-/ clear_bit it is...

Looking one more time... generic_file_write() is very odd:
        if (pos > inode->i_sb->s_maxbytes)
        {
                send_sig(SIGXFSZ, current, 0);
                err = -EFBIG;
                goto out;
        }

        if (pos + count > inode->i_sb->s_maxbytes)
        {
                count = inode->i_sb->s_maxbytes - count;
                goto out;
        }
 
looks funny - goto out means that new (and rather meaningless) value of
count goes to hell. Shouldn't we remove that line and s/- count/- pos/
in the previous one? Besides, do we really want the limit on size ber
0x.......f for ext2? 0x7fffffff comes from s32 returned by lseek(), and
thus - for size. ext2 limit should be a multiple of block size...

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



This archive was generated by hypermail 2b29 : Mon Jan 15 2001 - 21:00:18 EST