diff mbox series

fs/ceph:fix speical error code in ceph_try_get_caps()

Message ID 1588125715-188363-1-git-send-email-wubo40@huawei.com (mailing list archive)
State New, archived
Headers show
Series fs/ceph:fix speical error code in ceph_try_get_caps() | expand

Commit Message

Wu Bo April 29, 2020, 2:01 a.m. UTC
There are 3 speical error codes: -EAGAIN/-EFBIG/-ESTALE.
After call try_get_cap_refs function, judge the same 
error code -EAGAIN twice. So corrected the error code of judgment 
from -EAGAIN to -ESTAE.

Signed-off-by: Wu Bo <wubo40@huawei.com>
---
 fs/ceph/caps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeffrey Layton April 29, 2020, 3:37 p.m. UTC | #1
On Wed, 2020-04-29 at 10:01 +0800, Wu Bo wrote:
> There are 3 speical error codes: -EAGAIN/-EFBIG/-ESTALE.
> After call try_get_cap_refs function, judge the same 
> error code -EAGAIN twice. So corrected the error code of judgment 
> from -EAGAIN to -ESTAE.
> 
> Signed-off-by: Wu Bo <wubo40@huawei.com>
> ---
>  fs/ceph/caps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index 185db76..1a8e20e 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -2749,7 +2749,7 @@ int ceph_try_get_caps(struct inode *inode, int need, int want,
>  
>  	ret = try_get_cap_refs(inode, need, want, 0, flags, got);
>  	/* three special error codes */
> -	if (ret == -EAGAIN || ret == -EFBIG || ret == -EAGAIN)
> +	if (ret == -EAGAIN || ret == -EFBIG || ret == -ESTALE)
>  		ret = 0;
>  	return ret;
>  }

Good catch! Merged into testing branch.
diff mbox series

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 185db76..1a8e20e 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2749,7 +2749,7 @@  int ceph_try_get_caps(struct inode *inode, int need, int want,
 
 	ret = try_get_cap_refs(inode, need, want, 0, flags, got);
 	/* three special error codes */
-	if (ret == -EAGAIN || ret == -EFBIG || ret == -EAGAIN)
+	if (ret == -EAGAIN || ret == -EFBIG || ret == -ESTALE)
 		ret = 0;
 	return ret;
 }