Skip to content

Commit 4c4f0c2

Browse files
committed
Merge tag 'ceph-for-5.15-rc3' of git://github.com/ceph/ceph-client
Pull ceph fix from Ilya Dryomov: "A fix for a potential array out of bounds access from Dan" * tag 'ceph-for-5.15-rc3' of git://github.com/ceph/ceph-client: ceph: fix off by one bugs in unsafe_request_wait()
2 parents e655c81 + 708c871 commit 4c4f0c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ceph/caps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,7 @@ static int unsafe_request_wait(struct inode *inode)
22632263
list_for_each_entry(req, &ci->i_unsafe_dirops,
22642264
r_unsafe_dir_item) {
22652265
s = req->r_session;
2266-
if (unlikely(s->s_mds > max)) {
2266+
if (unlikely(s->s_mds >= max)) {
22672267
spin_unlock(&ci->i_unsafe_lock);
22682268
goto retry;
22692269
}
@@ -2277,7 +2277,7 @@ static int unsafe_request_wait(struct inode *inode)
22772277
list_for_each_entry(req, &ci->i_unsafe_iops,
22782278
r_unsafe_target_item) {
22792279
s = req->r_session;
2280-
if (unlikely(s->s_mds > max)) {
2280+
if (unlikely(s->s_mds >= max)) {
22812281
spin_unlock(&ci->i_unsafe_lock);
22822282
goto retry;
22832283
}

0 commit comments

Comments
 (0)