As noted by Fred Isaman, we prefer seeing the longer lsegs to the shorter. Otherwise, we prefer seeing RW lsegs to RO ones. Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx> --- fs/nfs/pnfs.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 589989d..9d41cab 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -686,19 +686,18 @@ cmp_layout(struct pnfs_layout_range *l1, { s64 d; - /* higher offset > lower offset */ + /* high offset > low offset */ d = l1->offset - l2->offset; if (d) return d; - /* longer length > shorter length */ - d = l1->length - l2->length; + /* short length > long length */ + d = l2->length - l1->length; if (d) return d; /* read > read/write */ - return (int)(l2->iomode == IOMODE_READ) - - (int)(l1->iomode == IOMODE_READ); + return (int)(l1->iomode == IOMODE_READ) - (int)(l2->iomode == IOMODE_READ); } static void -- 1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html