Re: 2.6.4-mm2

From: Andrew Morton
Date: Wed Mar 17 2004 - 19:14:36 EST


Chris Mason <mason@xxxxxxxx> wrote:
>
> On Wed, 2004-03-17 at 18:51, Andrew Morton wrote:
> > Chris Mason <mason@xxxxxxxx> wrote:
> > >
> > > Looks good, but I'm still having problems convincing pagevec_lookup_tag
> > > to return anything other than 0 when called from
> > > wait_on_page_writeback_range (ext2, ext3, reiserfs). Any ideas?
> >
> > This might help. I'm testing this path now, so there may be more changes..
> >
>
> Well, that's certainly a lot slower ;-)

For once, that's good.

> I've got a direct_read_under
> round going. While you're at it, there's one more bug.
>
> The wbc struct used by filemap_fdatawrite doesn't initialize
> wbc.nonblocking to zero. stack magic might give us a 1 there, leading
> to an early exit from mpage_writepages even when doing a WB_SYNC_ALL.

I hope not.

static int __filemap_fdatawrite(struct address_space *mapping, int sync_mode)
{
int ret;
struct writeback_control wbc = {
.sync_mode = sync_mode,
.nr_to_write = mapping->nrpages * 2,
};

When you initialise some of the structure in this way the compiler will
zero out all the other fields.

(gets worried)

yup.


struct thing {
int a;
int b[1000];
};

foo()
{
int a[1000];

memset(a, 1, sizeof(a));
}

bar()
{
struct thing t = {
.a = 1
};
int i;

for (i = 0; i < 1000; i++) {
if (t.b[i]) {
printf("bad\n");
return;
}
}
}

zot()
{
struct thing t;
int i;

for (i = 0; i < 1000; i++) {
if (t.b[i]) {
printf("good\n");
return;
}
}
}

main()
{
foo();
bar();
foo();
zot();
}


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