From 8475921b584f2cb6526c6800a78fc331114a4c59 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 23 Mar 2019 15:42:26 +0800 Subject: [PATCH] pNFS: Fix a typo in pnfs_update_layout mainline inclusion from mainline-5.1-rc1 commit 400417b05f3e category: bugfix bugzilla: 12777 CVE: NA ------------------------------------------------- We're supposed to wait for the outstanding layout count to go to zero, but that got lost somehow. Fixes: d03360aaf5cca ("pNFS: Ensure we return the error if someone...") Reported-by: Anna Schumaker Signed-off-by: Trond Myklebust Signed-off-by: ZhangXiaoxu Reviewed-by: zhengbin Signed-off-by: Yang Yingliang --- fs/nfs/pnfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 7d9a51e6b847..1aa628c98966 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1866,7 +1866,7 @@ pnfs_update_layout(struct inode *ino, atomic_read(&lo->plh_outstanding) != 0) { spin_unlock(&ino->i_lock); lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding, - atomic_read(&lo->plh_outstanding))); + !atomic_read(&lo->plh_outstanding))); if (IS_ERR(lseg) || !list_empty(&lo->plh_segs)) goto out_put_layout_hdr; pnfs_put_layout_hdr(lo); -- GitLab