diff options
Diffstat (limited to 'libbcachefs/snapshot.c')
-rw-r--r-- | libbcachefs/snapshot.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libbcachefs/snapshot.c b/libbcachefs/snapshot.c index fa7ad586..96744b1a 100644 --- a/libbcachefs/snapshot.c +++ b/libbcachefs/snapshot.c @@ -168,6 +168,9 @@ static noinline struct snapshot_t *__snapshot_t_mut(struct bch_fs *c, u32 id) size_t new_bytes = kmalloc_size_roundup(struct_size(new, s, idx + 1)); size_t new_size = (new_bytes - sizeof(*new)) / sizeof(new->s[0]); + if (unlikely(new_bytes > INT_MAX)) + return NULL; + new = kvzalloc(new_bytes, GFP_KERNEL); if (!new) return NULL; @@ -1682,6 +1685,8 @@ void bch2_delete_dead_snapshots_work(struct work_struct *work) { struct bch_fs *c = container_of(work, struct bch_fs, snapshot_delete_work); + set_worker_desc("bcachefs-delete-dead-snapshots/%s", c->name); + bch2_delete_dead_snapshots(c); bch2_write_ref_put(c, BCH_WRITE_REF_delete_dead_snapshots); } |