]> asedeno.scripts.mit.edu Git - linux.git/commit
btrfs: get rid of pointless wtag variable in async-thread.c
authorOmar Sandoval <osandov@fb.com>
Mon, 16 Sep 2019 18:30:58 +0000 (11:30 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 11:46:49 +0000 (12:46 +0100)
commitc9eb55db8439057165f106164622c146cdd59468
treebaf390f2f39d5262b7bfaa43df57bc30945dd7ad
parenta0cac0ec961f0d42828eeef196ac2246a2f07659
btrfs: get rid of pointless wtag variable in async-thread.c

Commit ac0c7cf8be00 ("btrfs: fix crash when tracepoint arguments are
freed by wq callbacks") added a void pointer, wtag, which is passed into
trace_btrfs_all_work_done() instead of the freed work item. This is
silly for a few reasons:

1. The freed work item still has the same address.
2. work is still in scope after it's freed, so assigning wtag doesn't
   stop anyone from using it.
3. The tracepoint has always taken a void * argument, so assigning wtag
   doesn't actually make things any more type-safe. (Note that the
   original bug in commit bc074524e123 ("btrfs: prefix fsid to all trace
   events") was that the void * was implicitly casted when it was passed
   to btrfs_work_owner() in the trace point itself).

Instead, let's add some clearer warnings as comments.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/async-thread.c
include/trace/events/btrfs.h