Re: [patch] mm: tiny-shmem fix lor, mmap_sem vs i_mutex

From: Hugh Dickins
Date: Wed Sep 24 2008 - 15:49:01 EST


On Wed, 24 Sep 2008, Matt Mackall wrote:
>
> Is there any reason I shouldn't use truncate() in regular shmem.c if I
> were to unify the two files?

The lock ordering bug is a good reason not to use do_truncate()
in either. Once Nick's fixup is in mainline, try the unification
based on that, including his #ifndef CONFIG_MMU which is good for
documentation.

But I don't know how ugly all the #ifdef'ing will end up: at the
time you created mm/tiny-shmem.c, we had a stronger embargo on
#ifdefs in *.c than is fashionable today.

If we're hell-bent on #ifdefs throughout mm/shmem.c, I wouldn't
mind scattering some CONFIG_SWAPs in there too, would cut out
lots of overhead when swap unconfigured. But again, how ugly?

Hugh
--
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/