diff mbox series

[16/18] lustre: llite: failed ASSERTION(ldlm_has_layout(lock))

Message ID 1626697933-6971-17-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to OpenSFS as of July 18, 2021 | expand

Commit Message

James Simmons July 19, 2021, 12:32 p.m. UTC
From: Bobi Jam <bobijam@whamcloud.com>

When setting layout in layout lock, the lock could lost its layout
bits, and we'd try fetch the layout lock again.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14780
Lustre-commit: 1b166d6dd6a2f39d ("LU-14780 llite: failed ASSERTION(ldlm_has_layout(lock))")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44054
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/file.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index 1ef5fd8..b822ca5 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -5609,7 +5609,11 @@  static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode,
 
 	lock = ldlm_handle2lock(lockh);
 	LASSERT(lock);
-	LASSERT(ldlm_has_layout(lock));
+
+	if (!ldlm_has_layout(lock)) {
+		rc = -EAGAIN;
+		goto out;
+	}
 
 	LDLM_DEBUG(lock, "File " DFID "(%p) being reconfigured",
 		   PFID(&lli->lli_fid), inode);