projects
/
linux
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4007bbb
)
bcachefs: fix disk reservation accounting in bch2_folio_reservation_get()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 14 Oct 2024 21:55:48 +0000
(17:55 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Fri, 18 Oct 2024 04:49:48 +0000
(
00:49
-0400)
bch2_disk_reservation_put() zeroes out the reservation - oops.
This fixes a disk reservation leak when getting a quota reservation
returned an error.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io-pagecache.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/fs-io-pagecache.c
b/fs/bcachefs/fs-io-pagecache.c
index af3a24546aa370e8cc89be9616bb4f96aa740b77..cde3a0445ee946e22cd7ad06d745a29ee9574131 100644
(file)
--- a/
fs/bcachefs/fs-io-pagecache.c
+++ b/
fs/bcachefs/fs-io-pagecache.c
@@
-431,9
+431,9
@@
int bch2_folio_reservation_get(struct bch_fs *c,
ret = bch2_quota_reservation_add(c, inode, &res->quota, quota_sectors, true);
if (unlikely(ret)) {
struct disk_reservation tmp = { .sectors = disk_sectors };
+ res->disk.sectors -= disk_sectors;
bch2_disk_reservation_put(c, &tmp);
- res->disk.sectors -= disk_sectors;
return ret;
}
}