diff mbox

[V2,1/2] mds: Fix SessionMap::is_any_state()

Message ID 1348486029-1125-1-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Sept. 24, 2012, 11:27 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

is_any_state() should return false when the by_state list is empty.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/SessionMap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sage Weil Sept. 24, 2012, 4:40 p.m. UTC | #1
Applied, thanks!

On Mon, 24 Sep 2012, Yan, Zheng wrote:

> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 
> is_any_state() should return false when the by_state list is empty.
> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  src/mds/SessionMap.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h
> index fcd0b47..6bca361 100644
> --- a/src/mds/SessionMap.h
> +++ b/src/mds/SessionMap.h
> @@ -248,7 +248,7 @@ public:
>  
>    bool is_any_state(int state) {
>      map<int,xlist<Session*>* >::iterator p = by_state.find(state);
> -    if (p == by_state.end())
> +    if (p == by_state.end() || p->second->empty())
>        return false;
>      return true;
>    }
> -- 
> 1.7.11.4
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h
index fcd0b47..6bca361 100644
--- a/src/mds/SessionMap.h
+++ b/src/mds/SessionMap.h
@@ -248,7 +248,7 @@  public:
 
   bool is_any_state(int state) {
     map<int,xlist<Session*>* >::iterator p = by_state.find(state);
-    if (p == by_state.end())
+    if (p == by_state.end() || p->second->empty())
       return false;
     return true;
   }