diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-06-18 19:55:32 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:34 -0400 |
commit | a3d7afa5c1b62140168982747fd15c1999d991f4 (patch) | |
tree | d1bd1ea4f390c17225ff423a5ef99450f8e177a3 /fs/bcachefs/sysfs.c | |
parent | 23189da9eb6b34fc1ceb077edb32e308d0ad6760 (diff) | |
download | linux-a3d7afa5c1b62140168982747fd15c1999d991f4.tar.gz linux-a3d7afa5c1b62140168982747fd15c1999d991f4.tar.bz2 linux-a3d7afa5c1b62140168982747fd15c1999d991f4.zip |
bcachefs: Always use percpu_ref_tryget_live() on c->writes
If we're trying to get a ref and the refcount has been killed, it means
we're doing an emergency shutdown - we always want tryget_live().
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-rw-r--r-- | fs/bcachefs/sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index 173289c34de0..4e2b6285cf3a 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -676,7 +676,7 @@ STORE(bch2_fs_opts_dir) * We don't need to take c->writes for correctness, but it eliminates an * unsightly error message in the dmesg log when we're RO: */ - if (unlikely(!percpu_ref_tryget(&c->writes))) + if (unlikely(!percpu_ref_tryget_live(&c->writes))) return -EROFS; tmp = kstrdup(buf, GFP_KERNEL); |