* [PATCH 1/1] nfs4.1: pnfs_find_lseg only looks at first element in list
@ 2011-06-14 13:56 Fred Isaman
2011-06-14 14:38 ` Benny Halevy
0 siblings, 1 reply; 3+ messages in thread
From: Fred Isaman @ 2011-06-14 13:56 UTC (permalink / raw)
To: linux-nfs; +Cc: Trond Myklebust, Fred Isaman
The break condition to skip out of the loop if we've gone too far was
reversed, causing the function to abort after looking at the first
list entry.
Reported-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
fs/nfs/pnfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 1abb300..c640f91 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -895,7 +895,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
ret = get_lseg(lseg);
break;
}
- if (cmp_layout(range, &lseg->pls_range) > 0)
+ if (cmp_layout(range, &lseg->pls_range) < 0)
break;
}
--
1.7.2.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] nfs4.1: pnfs_find_lseg only looks at first element in list
2011-06-14 13:56 [PATCH 1/1] nfs4.1: pnfs_find_lseg only looks at first element in list Fred Isaman
@ 2011-06-14 14:38 ` Benny Halevy
2011-06-14 20:30 ` [PATCH] NFSv4.1: fix break condition in pnfs_find_lseg Benny Halevy
0 siblings, 1 reply; 3+ messages in thread
From: Benny Halevy @ 2011-06-14 14:38 UTC (permalink / raw)
To: Fred Isaman; +Cc: linux-nfs, Trond Myklebust
On 2011-06-14 09:56, Fred Isaman wrote:
> The break condition to skip out of the loop if we've gone too far was
> reversed, causing the function to abort after looking at the first
> list entry.
>
> Reported-by: Peng Tao <peng_tao@emc.com>
> Signed-off-by: Fred Isaman <iisaman@netapp.com>
> ---
> fs/nfs/pnfs.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index 1abb300..c640f91 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -895,7 +895,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
> ret = get_lseg(lseg);
> break;
> }
> - if (cmp_layout(range, &lseg->pls_range) > 0)
> + if (cmp_layout(range, &lseg->pls_range) < 0)
Fred, this is too harsh since we might break if range->offset == lseg->pls_range.offset
&& range->length > lseg->pls_range.length.
The simplest condition is just:
if (lseg->pls_range.offset > range->offset)
Benny
> break;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] NFSv4.1: fix break condition in pnfs_find_lseg
2011-06-14 14:38 ` Benny Halevy
@ 2011-06-14 20:30 ` Benny Halevy
0 siblings, 0 replies; 3+ messages in thread
From: Benny Halevy @ 2011-06-14 20:30 UTC (permalink / raw)
To: Trond.Myklebust; +Cc: linux-nfs, iisaman, Benny Halevy
The break condition to skip out of the loop got broken when cmp_layout
was change. Essentially, we want to stop looking once we know no layout
on the remainder of the list can match the first byte of the looked-up
range.
Reported-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Benny Halevy <benny@tonian.com>
---
fs/nfs/pnfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 08c115d..b3994e1 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -895,7 +895,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
ret = get_lseg(lseg);
break;
}
- if (cmp_layout(range, &lseg->pls_range) > 0)
+ if (lseg->pls_range.offset > range->offset)
break;
}
--
1.7.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-14 20:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 13:56 [PATCH 1/1] nfs4.1: pnfs_find_lseg only looks at first element in list Fred Isaman
2011-06-14 14:38 ` Benny Halevy
2011-06-14 20:30 ` [PATCH] NFSv4.1: fix break condition in pnfs_find_lseg Benny Halevy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).