Am 19.01.2010 19:53, schrieb Christoph Hellwig: >> #endif >> - if (length <= 0) >> + if (length < 0) { >> return -EINVAL; >> + } >> + >> start = offset & ~(s->cluster_size - 1); >> last = (offset + length - 1) & ~(s->cluster_size - 1); >> for(cluster_offset = start; cluster_offset <= last; > > So for legnth = 0, last will equal start and we'll never go through > the loop. But should we really bother with all the other work in the > function or just return 0 early on?
I'm not a big fan of special-casing for no real reason ("all the other work" basically is calculating start and last and skipping two ifs - and length = 0 is an unusual case anyway), but if you really mind we can change it. Kevin