mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
Update bcachefs sources to fd381c355c bcachefs: Fix a null ptr deref in fsck check_extents()
This commit is contained in:
parent
42edda8db6
commit
9690f78356
@ -1 +1 @@
|
|||||||
22ccceee1555cd9a66f0b444634a7c0099a73d77
|
fd381c355c92ad0e3abfc49c7675893ed355686f
|
||||||
|
@ -75,6 +75,9 @@ enum ask_yn {
|
|||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
#define bch2_fsck_ask_yn() YN_NO
|
#define bch2_fsck_ask_yn() YN_NO
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include "tools-util.h"
|
||||||
|
|
||||||
enum ask_yn bch2_fsck_ask_yn(void)
|
enum ask_yn bch2_fsck_ask_yn(void)
|
||||||
{
|
{
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
@ -106,6 +109,7 @@ enum ask_yn bch2_fsck_ask_yn(void)
|
|||||||
free(buf);
|
free(buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct fsck_err_state *fsck_err_get(struct bch_fs *c, const char *fmt)
|
static struct fsck_err_state *fsck_err_get(struct bch_fs *c, const char *fmt)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "bcachefs.h"
|
#include "bcachefs.h"
|
||||||
#include "bkey_buf.h"
|
#include "bkey_buf.h"
|
||||||
#include "btree_update.h"
|
#include "btree_update.h"
|
||||||
|
#include "buckets.h"
|
||||||
#include "darray.h"
|
#include "darray.h"
|
||||||
#include "dirent.h"
|
#include "dirent.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
@ -1407,6 +1408,7 @@ static int check_extents(struct bch_fs *c)
|
|||||||
struct btree_iter iter;
|
struct btree_iter iter;
|
||||||
struct bkey_s_c k;
|
struct bkey_s_c k;
|
||||||
extent_ends extent_ends = { 0 };
|
extent_ends extent_ends = { 0 };
|
||||||
|
struct disk_reservation res = { 0 };
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
snapshots_seen_init(&s);
|
snapshots_seen_init(&s);
|
||||||
@ -1417,10 +1419,13 @@ static int check_extents(struct bch_fs *c)
|
|||||||
ret = for_each_btree_key_commit(&trans, iter, BTREE_ID_extents,
|
ret = for_each_btree_key_commit(&trans, iter, BTREE_ID_extents,
|
||||||
POS(BCACHEFS_ROOT_INO, 0),
|
POS(BCACHEFS_ROOT_INO, 0),
|
||||||
BTREE_ITER_PREFETCH|BTREE_ITER_ALL_SNAPSHOTS, k,
|
BTREE_ITER_PREFETCH|BTREE_ITER_ALL_SNAPSHOTS, k,
|
||||||
NULL, NULL,
|
&res, NULL,
|
||||||
BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL,
|
BTREE_INSERT_LAZY_RW|BTREE_INSERT_NOFAIL, ({
|
||||||
check_extent(&trans, &iter, k, &w, &s, &extent_ends));
|
bch2_disk_reservation_put(c, &res);
|
||||||
|
check_extent(&trans, &iter, k, &w, &s, &extent_ends);
|
||||||
|
}));
|
||||||
|
|
||||||
|
bch2_disk_reservation_put(c, &res);
|
||||||
extent_ends_reset(&extent_ends);
|
extent_ends_reset(&extent_ends);
|
||||||
darray_exit(&extent_ends);
|
darray_exit(&extent_ends);
|
||||||
inode_walker_exit(&w);
|
inode_walker_exit(&w);
|
||||||
|
Loading…
Reference in New Issue
Block a user