Re: [PATCH 2/4] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-07-19 Thread Jeff Layton
On Sat, 2019-07-20 at 00:30 +0100, Al Viro wrote: > On Sat, Jul 20, 2019 at 12:23:08AM +0100, Al Viro wrote: > > On Fri, Jul 19, 2019 at 07:07:49PM -0400, Jeff Layton wrote: > > > > > Al pointed out on IRC that vfree should be callable under spinlock. > > > > Al had been near-terminally low on ca

Re: [PATCH 2/4] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-07-19 Thread Al Viro
On Sat, Jul 20, 2019 at 12:23:08AM +0100, Al Viro wrote: > On Fri, Jul 19, 2019 at 07:07:49PM -0400, Jeff Layton wrote: > > > Al pointed out on IRC that vfree should be callable under spinlock. > > Al had been near-terminally low on caffeine at the time, posted > a retraction a few minutes later

Re: [PATCH 2/4] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-07-19 Thread Al Viro
On Fri, Jul 19, 2019 at 07:07:49PM -0400, Jeff Layton wrote: > Al pointed out on IRC that vfree should be callable under spinlock. Al had been near-terminally low on caffeine at the time, posted a retraction a few minutes later and went to grab some coffee... > It > only sleeps if !in_interrupt(

Re: [PATCH 2/4] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-07-19 Thread Jeff Layton
On Fri, 2019-07-19 at 15:32 +0100, Luis Henriques wrote: > Calling ceph_buffer_put() in __ceph_setxattr() may end up freeing the > i_xattrs.prealloc_blob buffer while holding the i_ceph_lock. This can be > fixed by postponing the call until later, when the lock is released. > > The following back

[PATCH 2/4] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr()

2019-07-19 Thread Luis Henriques
Calling ceph_buffer_put() in __ceph_setxattr() may end up freeing the i_xattrs.prealloc_blob buffer while holding the i_ceph_lock. This can be fixed by postponing the call until later, when the lock is released. The following backtrace was triggered by fstests generic/117. BUG: sleeping functi