LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/8] ceph: fix error handling in ceph_get_caps()
@ 2019-05-23  8:06 Yan, Zheng
  2019-05-23  8:06 ` [PATCH 2/8] ceph: single workqueue for inode related works Yan, Zheng
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Yan, Zheng @ 2019-05-23  8:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: idryomov, jlayton

The function return 0 even when interrupted or try_get_cap_refs()
return error.

Introduce by commit 1199d7da2d "ceph: simplify arguments and return
semantics of try_get_cap_refs"

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
---
 fs/ceph/caps.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 72f8e1311392..079d0df9650c 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2738,15 +2738,13 @@ int ceph_get_caps(struct ceph_inode_info *ci, int need, int want,
 		_got = 0;
 		ret = try_get_cap_refs(ci, need, want, endoff,
 				       false, &_got);
-		if (ret == -EAGAIN) {
+		if (ret == -EAGAIN)
 			continue;
-		} else if (!ret) {
-			int err;
-
+		if (!ret) {
 			DEFINE_WAIT_FUNC(wait, woken_wake_function);
 			add_wait_queue(&ci->i_cap_wq, &wait);
 
-			while (!(err = try_get_cap_refs(ci, need, want, endoff,
+			while (!(ret = try_get_cap_refs(ci, need, want, endoff,
 							true, &_got))) {
 				if (signal_pending(current)) {
 					ret = -ERESTARTSYS;
@@ -2756,14 +2754,16 @@ int ceph_get_caps(struct ceph_inode_info *ci, int need, int want,
 			}
 
 			remove_wait_queue(&ci->i_cap_wq, &wait);
-			if (err == -EAGAIN)
+			if (ret == -EAGAIN)
 				continue;
 		}
-		if (ret == -ESTALE) {
-			/* session was killed, try renew caps */
-			ret = ceph_renew_caps(&ci->vfs_inode);
-			if (ret == 0)
-				continue;
+		if (ret < 0) {
+			if (ret == -ESTALE) {
+				/* session was killed, try renew caps */
+				ret = ceph_renew_caps(&ci->vfs_inode);
+				if (ret == 0)
+					continue;
+			}
 			return ret;
 		}
 
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-02  8:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  8:06 [PATCH 1/8] ceph: fix error handling in ceph_get_caps() Yan, Zheng
2019-05-23  8:06 ` [PATCH 2/8] ceph: single workqueue for inode related works Yan, Zheng
2019-05-23  8:06 ` [PATCH 3/8] ceph: avoid iput_final() while holding mutex or in dispatch thread Yan, Zheng
2019-05-23  8:06 ` [PATCH 4/8] ceph: close race between d_name_cmp() and update_dentry_lease() Yan, Zheng
2019-05-23  8:06 ` [PATCH 5/8] ceph: fix dir_lease_is_valid() Yan, Zheng
2019-05-23  8:06 ` [PATCH 6/8] ceph: use READ_ONCE to access d_parent in RCU critical section Yan, Zheng
2019-05-23  8:06 ` [PATCH 7/8] ceph: ensure d_name/d_parent stability in ceph_mdsc_lease_send_msg() Yan, Zheng
2019-05-23  8:06 ` [PATCH 8/8] ceph: hold i_ceph_lock when removing caps for freeing inode Yan, Zheng
2019-05-29 13:14   ` Sasha Levin
2019-05-30  1:46     ` Yan, Zheng
2019-08-02  8:13       ` Greg KH

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).