Re: [PATCH NFS 3/3] Replace nfs_block_bits() withroundup_pow_of_two()

From: Trond Myklebust
Date: Sun Jul 24 2005 - 18:26:32 EST

su den 24.07.2005 Klokka 19:09 (-0400) skreiv Trond Myklebust:
> su den 24.07.2005 Klokka 16:36 (+0200) skreiv Rene Scharfe:
> > [PATCH NFS 3/3] Replace nfs_block_bits() with roundup_pow_of_two()
> >
> > Function nfs_block_bits() an open-coded version of (the non-existing)
> > rounddown_pow_of_two(). That means that for non-power-of-two target
> > sizes it returns half the size needed for a block to fully contain
> > the target. I guess this is wrong. :-) The patch uses the built-in
> > roundup_pow_of_two() instead.
> What non-power-of-two target? Anything _not_ aligned to a power of two
> boundary is a BUG!

Furthermore, rounding UP in order to "correct" this non-alignment would
definitely be a bug.

If users choose to override the default rsize/wsize, that is almost
always in order to limit the UDP fragmentation per read/write request on
lossy networks. By rounding up, you are doubling the number of fragments
that the user requested instead of respecting the limit.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at