diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-09-25 03:05:50 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:10:15 +0200 |
commit | efedfc2ece141389a9f522a298781cc929262701 (patch) | |
tree | 5366c14ae7f17e6e6ec1028e5c4412e67c7a0758 /fs/bcachefs/io_write.c | |
parent | bcachefs: Fixes for building in userspace (diff) | |
download | linux-efedfc2ece141389a9f522a298781cc929262701.tar.xz linux-efedfc2ece141389a9f522a298781cc929262701.zip |
bcachefs: nocow locking: Fix lock leak
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io_write.c')
-rw-r--r-- | fs/bcachefs/io_write.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index d2a0de886c7a..6e4f85eb6ec8 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -1376,10 +1376,12 @@ err_get_ioref: /* Fall back to COW path: */ goto out; err_bucket_stale: - while (--i >= 0) + while (i >= 0) { bch2_bucket_nocow_unlock(&c->nocow_locks, buckets[i].b, BUCKET_NOCOW_LOCK_UPDATE); + --i; + } for (i = 0; i < nr_buckets; i++) percpu_ref_put(&bch_dev_bkey_exists(c, buckets[i].b.inode)->io_ref); |