mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
functionfs: need to cancel ->reset_work in ->kill_sb()
... otherwise we just might free ffs with ffs->reset_work still on queue. That needs to be done after ffs_data_reset() - that's the cutoff point for configfs accesses (serialized on gadget_info->lock), which is where the schedule_work() would come from. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -2081,6 +2081,9 @@ ffs_fs_kill_sb(struct super_block *sb)
|
||||
struct ffs_data *ffs = sb->s_fs_info;
|
||||
ffs->state = FFS_CLOSING;
|
||||
ffs_data_reset(ffs);
|
||||
// no configfs accesses from that point on,
|
||||
// so no further schedule_work() is possible
|
||||
cancel_work_sync(&ffs->reset_work);
|
||||
ffs_data_put(ffs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user