OSDN Git Service

aio: restore locking of ioctx list on removal
authorMateusz Guzik <mguzik@redhat.com>
Thu, 5 Dec 2013 10:09:02 +0000 (11:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Dec 2013 15:29:27 +0000 (07:29 -0800)
commitf8715e7d2a096cedd1c5ef4768deae7126659dcf
treea013b91b5bd6f58d7adeea9b96bf4ce6b3ef7645
parent604ae797e7cd1eca7897eac555961a5a25a9bde5
aio: restore locking of ioctx list on removal

Commit 36f5588905c10a8c4568a210d601fe8c3c27e0f0
"aio: refcounting cleanup" resulted in ioctx_lock not being held
during ctx removal, leaving the list susceptible to corruptions.

In mainline kernel the issue went away as a side effect of
db446a08c23d5475e6b08c87acca79ebb20f283c "aio: convert the ioctx list to
table lookup v3".

Fix the problem by restoring appropriate locking.

Signed-off-by: Mateusz Guzik <mguzik@redhat.com>
Reported-by: Eryu Guan <eguan@redhat.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Kent Overstreet <kmo@daterainc.com>
Acked-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/aio.c