Skip to content

Commit 42d70f8

Browse files
ukernelidryomov
authored andcommitted
ceph: request new max size only when there is auth cap
When there is no auth cap, check_max_size() can't do anything and may cause an infinite loop inside ceph_get_caps(). Signed-off-by: "Yan, Zheng" <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 546d402 commit 42d70f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ceph/caps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ static int try_get_cap_refs(struct inode *inode, int need, int want,
25822582
dout("get_cap_refs %p endoff %llu > maxsize %llu\n",
25832583
inode, endoff, ci->i_max_size);
25842584
if (endoff > ci->i_requested_max_size)
2585-
ret = -EFBIG;
2585+
ret = ci->i_auth_cap ? -EFBIG : -ESTALE;
25862586
goto out_unlock;
25872587
}
25882588
/*

0 commit comments

Comments
 (0)