Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3c58f64
userfaultfd: prevent registration of special VMAs
rppt Jun 18, 2026
14afcf6
MAINTAINERS: s/SeongJae/SJ/
sjp38 Jun 30, 2026
f84ca9b
mm/page_vma_mapped: fix device-private PMD handling
RichardWeiYang Jun 30, 2026
e1cd30e
mm/huge_memory: set PG_has_hwpoisoned only after new folio head is es…
rikvanriel Jul 1, 2026
955b67c
m68k: avoid -Wunused-but-set-parameter in clear_user_page()
t-8ch May 25, 2026
1292c0e
mm/damon/core: validate ranges in damon_set_regions()
sjp38 Jun 30, 2026
e1a1729
fat: avoid stack overflow warning
arndb May 15, 2026
f8ed699
MAINTAINERS: add Usama as a THP reviewer
ioworker0 Jul 2, 2026
9541576
mm/damon/core: disallow overlapping input ranges for damon_set_regions()
sjp38 Jul 3, 2026
79c37ae
mm/kmemleak: fix checksum computation for per-cpu objects
leitao Jul 3, 2026
47c81da
mm: page_reporting: allow driver to set batch capacity
mstsirkin Jul 5, 2026
e57d6e9
mm/memory-failure: trace: change memory_failure_event to ras subsystem
xieyuanbin1-huawei Jun 5, 2026
1ecb29b
x86/cpu: Remove Makefile rule for removed UMC CPU support
EthanNelson-Moore Jun 10, 2026
d130041
x86/boot: Reject too long acpi_rsdp= values
toblux Jun 21, 2026
b6ea968
riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU
dramforever Jul 13, 2026
4edd70e
mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap
dramforever Jul 13, 2026
3a2694b
riscv: Gate FUNCTION_ALIGNMENT_4B on DYNAMIC_FTRACE
qiruibd Jul 6, 2026
6dc3934
riscv: io: avoid null-pointer arithmetic in PIO helpers
cuiyunhui Jul 3, 2026
ad6dcfa
riscv: vdso: Do not use LTO for the vDSO
t-8ch Jul 1, 2026
ffa0aa5
x86/boot: Validate console=uart8250 baud rate to fix early boot hang
toblux Jul 13, 2026
0bcd597
spi: dw-dma: Wait for controller idle before completing Tx
WangYuWei1999 Jul 6, 2026
e919ca3
spi: cadence-quadspi: Fix indirect write timeout when DMA read mode i…
SrikanthGoud123 Jul 8, 2026
f1596ba
io_uring/kbuf: free the replaced iovec after a successful grow
Jul 12, 2026
cc60937
io_uring/fs: check unused sqe fields for unlinkat
Jul 14, 2026
e4bf6eb
arch/riscv: vdso: remove CFI landing pad from rt_sigreturn
aurel32 Jun 23, 2026
5caae1d
riscv: hwprobe: Avoid uninitialized read in hwprobe_get_cpus()
mark4o Jul 14, 2026
691b052
block: fix race in blk_time_get_ns() returning 0
waych Jul 15, 2026
c4f4c0f
loop: remove manually added partitions on detach
daandemeyer Jul 15, 2026
dbbca20
blk-cgroup: fix leaks and online flag on radix_tree_insert failure
Jul 15, 2026
d35e236
partitions: aix: bound the lvd scan to one sector
mjbommar Jul 14, 2026
daff723
block: do not warn when doing greedy allocation in folio_alloc_greedy()
adam900710 Jul 14, 2026
bd2df8d
block: free copied pages when blk_rq_map_kern() fails
JackieLiu1 Jul 15, 2026
4ff58d6
block: serialize elevator changes for the same queue using a writer lock
kawasaki Jul 16, 2026
f94de43
block: show operation in error injection rules
JackieLiu1 Jul 15, 2026
447cfed
block: try slab allocation in bio_alloc_bioset() before mempool
josephhz Jul 9, 2026
4f221ef
block: handle huge zero folios in bio_free_folios
Jul 16, 2026
df308a1
block: fix aligning of bounced dio read bios
Jul 16, 2026
50dce2e
regulator: ltc3676: Fix incorrect IRQSTAT bit offsets
abhishekojhasfl Jul 15, 2026
8173f7e
rhashtable: clear stale iter->p on table restart
occia Jul 7, 2026
3afc64c
io_uring/bpf-ops: reject re-registration of an already-bound ops
Wrptt3885 Jul 17, 2026
502c9e9
Merge tag 'x86-urgent-2026-07-19' of git://git.kernel.org/pub/scm/lin…
torvalds Jul 19, 2026
6eb9466
Merge tag 'regulator-fix-v7.2-rc3' of git://git.kernel.org/pub/scm/li…
torvalds Jul 19, 2026
8b752c8
Merge tag 'spi-fix-v7.2-rc3' of git://git.kernel.org/pub/scm/linux/ke…
torvalds Jul 19, 2026
a2b81de
Merge tag 'io_uring-7.2-20260717' of git://git.kernel.org/pub/scm/lin…
torvalds Jul 19, 2026
980ab36
Merge tag 'block-7.2-20260717' of git://git.kernel.org/pub/scm/linux/…
torvalds Jul 19, 2026
82a4758
Merge tag 'riscv-for-linus-7.2-rc4' of git://git.kernel.org/pub/scm/l…
torvalds Jul 19, 2026
1590cf0
Linux 7.2-rc4
torvalds Jul 19, 2026
abc69ae
Merge tag 'v7.2-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/…
torvalds Jul 20, 2026
b95f03f
Merge tag 'mm-hotfixes-stable-2026-07-20-11-37' of git://git.kernel.o…
torvalds Jul 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ Simon Wunderlich <sw@simonwunderlich.de> <simon.wunderlich@s2003.tu-chemnitz.de>
Simon Wunderlich <sw@simonwunderlich.de> <simon.wunderlich@saxnet.de>
Simon Wunderlich <sw@simonwunderlich.de> <simon@open-mesh.com>
Simon Wunderlich <sw@simonwunderlich.de> <siwu@hrz.tu-chemnitz.de>
SJ Park <sj@kernel.org>
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
Srinivas Kandagatla <srini@kernel.org> <srinivas.kandagatla@st.com>
Srinivas Kandagatla <srini@kernel.org> <srinivas.kandagatla@linaro.org>
Expand Down
174 changes: 87 additions & 87 deletions Documentation/ABI/testing/sysfs-kernel-mm-damon

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7125,7 +7125,7 @@ W: https://docs.dasharo.com/
F: drivers/platform/x86/dasharo-acpi.c

DAMON
M: SeongJae Park <sj@kernel.org>
M: SJ Park <sj@kernel.org>
L: damon@lists.linux.dev
L: linux-mm@kvack.org
S: Maintained
Expand Down Expand Up @@ -17257,6 +17257,7 @@ R: Ryan Roberts <ryan.roberts@arm.com>
R: Dev Jain <dev.jain@arm.com>
R: Barry Song <baohua@kernel.org>
R: Lance Yang <lance.yang@linux.dev>
R: Usama Arif <usama.arif@linux.dev>
L: linux-mm@kvack.org
S: Maintained
W: http://www.linux-mm.org
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
VERSION = 7
PATCHLEVEL = 2
SUBLEVEL = 0
EXTRAVERSION = -rc3
EXTRAVERSION = -rc4
NAME = Baby Opossum Posse

# *DOCUMENTATION*
Expand Down
2 changes: 2 additions & 0 deletions arch/m68k/include/asm/page_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ static inline void clear_page(void *page)
#define clear_user_page(addr, vaddr, page) \
do { clear_page(addr); \
flush_dcache_page(page); \
(void)(vaddr); \
} while (0)
#define copy_user_page(to, from, vaddr, page) \
do { copy_page(to, from); \
flush_dcache_page(page); \
(void)(vaddr); \
} while (0)

extern unsigned long m68k_memoffset;
Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ config RISCV
select HAVE_DEBUG_KMEMLEAK
select HAVE_DMA_CONTIGUOUS if MMU
select HAVE_DYNAMIC_FTRACE if MMU && (CLANG_SUPPORTS_DYNAMIC_FTRACE || GCC_SUPPORTS_DYNAMIC_FTRACE)
select FUNCTION_ALIGNMENT_4B if HAVE_DYNAMIC_FTRACE && RISCV_ISA_C
select FUNCTION_ALIGNMENT_4B if DYNAMIC_FTRACE && RISCV_ISA_C
select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS if HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS
select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS if (DYNAMIC_FTRACE_WITH_ARGS && !CFI)
select HAVE_DYNAMIC_FTRACE_WITH_ARGS if HAVE_DYNAMIC_FTRACE
Expand Down
5 changes: 3 additions & 2 deletions arch/riscv/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ do { \
flush_icache_mm(vma->vm_mm, 0); \
} while (0)

#ifdef CONFIG_64BIT
#if defined(CONFIG_64BIT) && defined(CONFIG_MMU)
/* This is accessed in assembly code. cpumask_var_t would be too complex. */
extern DECLARE_BITMAP(new_valid_map_cpus, NR_CPUS);
extern char _end[];
Expand All @@ -56,7 +56,8 @@ static inline void mark_new_valid_map(void)
#define flush_cache_vmap flush_cache_vmap
static inline void flush_cache_vmap(unsigned long start, unsigned long end)
{
if (is_vmalloc_or_module_addr((void *)start))
if (is_vmalloc_or_module_addr((void *)start) ||
(start >= VMEMMAP_START && end <= VMEMMAP_END))
mark_new_valid_map();
}
#define flush_cache_vmap_early(start, end) local_flush_tlb_kernel_range(start, end)
Expand Down
8 changes: 8 additions & 0 deletions arch/riscv/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar(addr))
#define readsw(addr, buffer, count) __readsw(addr, buffer, count)
#define readsl(addr, buffer, count) __readsl(addr, buffer, count)

#ifdef CONFIG_HAS_IOPORT
__io_reads_ins(ins, u8, b, __io_pbr(), __io_par(addr))
__io_reads_ins(ins, u16, w, __io_pbr(), __io_par(addr))
__io_reads_ins(ins, u32, l, __io_pbr(), __io_par(addr))
#define insb(addr, buffer, count) __insb(PCI_IOBASE + (addr), buffer, count)
#define insw(addr, buffer, count) __insw(PCI_IOBASE + (addr), buffer, count)
#define insl(addr, buffer, count) __insl(PCI_IOBASE + (addr), buffer, count)
#endif

__io_writes_outs(writes, u8, b, __io_bw(), __io_aw())
__io_writes_outs(writes, u16, w, __io_bw(), __io_aw())
Expand All @@ -116,26 +118,32 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw())
#define writesw(addr, buffer, count) __writesw(addr, buffer, count)
#define writesl(addr, buffer, count) __writesl(addr, buffer, count)

#ifdef CONFIG_HAS_IOPORT
__io_writes_outs(outs, u8, b, __io_pbw(), __io_paw())
__io_writes_outs(outs, u16, w, __io_pbw(), __io_paw())
__io_writes_outs(outs, u32, l, __io_pbw(), __io_paw())
#define outsb(addr, buffer, count) __outsb(PCI_IOBASE + (addr), buffer, count)
#define outsw(addr, buffer, count) __outsw(PCI_IOBASE + (addr), buffer, count)
#define outsl(addr, buffer, count) __outsl(PCI_IOBASE + (addr), buffer, count)
#endif

#ifdef CONFIG_64BIT
__io_reads_ins(reads, u64, q, __io_br(), __io_ar(addr))
#define readsq(addr, buffer, count) __readsq(addr, buffer, count)

#ifdef CONFIG_HAS_IOPORT
__io_reads_ins(ins, u64, q, __io_pbr(), __io_par(addr))
#define insq(addr, buffer, count) __insq(PCI_IOBASE + (addr), buffer, count)
#endif

__io_writes_outs(writes, u64, q, __io_bw(), __io_aw())
#define writesq(addr, buffer, count) __writesq(addr, buffer, count)

#ifdef CONFIG_HAS_IOPORT
__io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
#define outsq(addr, buffer, count) __outsq(PCI_IOBASE + (addr), buffer, count)
#endif
#endif

#include <asm-generic/io.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ SYM_CODE_START(handle_exception)
.Lrestore_kernel_tpsp:
csrr tp, CSR_SCRATCH

#ifdef CONFIG_64BIT
#if defined(CONFIG_64BIT) && defined(CONFIG_MMU)
/*
* The RISC-V kernel does not flush TLBs on all CPUS after each new
* vmalloc mapping or kfence_unprotect(), which may result in
Expand Down
1 change: 1 addition & 0 deletions arch/riscv/kernel/sys_hwprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ static int hwprobe_get_cpus(struct riscv_hwprobe __user *pairs,
if (cpusetsize > cpumask_size())
cpusetsize = cpumask_size();

cpumask_clear(&cpus);
ret = copy_from_user(&cpus, cpus_user, cpusetsize);
if (ret)
return -EFAULT;
Expand Down
6 changes: 3 additions & 3 deletions arch/riscv/kernel/vdso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ CPPFLAGS_$(vdso_lds) += -DHAS_VGETTIMEOFDAY
endif

# Disable -pg to prevent insert call site
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS)
CFLAGS_REMOVE_getrandom.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS)
CFLAGS_REMOVE_hwprobe.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS)
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_LTO)
CFLAGS_REMOVE_getrandom.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_LTO)
CFLAGS_REMOVE_hwprobe.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_LTO)

# Force dependency
$(obj)/$(vdso_o): $(obj)/$(vdso_so)
Expand Down
10 changes: 9 additions & 1 deletion arch/riscv/kernel/vdso/rt_sigreturn.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
#include <asm/unistd.h>
#include <asm/assembler.h>

/*
* WARNING: Do NOT add a CFI landing pad at the start of this function.
* Unwinders such as libgcc identify the sigreturn trampoline by matching the
* instruction sequence. Adding a landing pad here would break unwinding from
* signal handlers.
*
* This trampoline is used only for signal return and not via an indirect
* call/jump from userspace, so adding CFI landing pad is unnecessary.
*/
.text
SYM_FUNC_START(__vdso_rt_sigreturn)
.cfi_startproc
.cfi_signal_frame
vdso_lpad
li a7, __NR_rt_sigreturn
ecall
.cfi_endproc
Expand Down
2 changes: 2 additions & 0 deletions arch/riscv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

#include "../kernel/head.h"

#if defined(CONFIG_64BIT) && defined(CONFIG_MMU)
DECLARE_BITMAP(new_valid_map_cpus, NR_CPUS);
#endif

struct kernel_mapping kernel_map __ro_after_init;
EXPORT_SYMBOL(kernel_map);
Expand Down
7 changes: 6 additions & 1 deletion arch/x86/boot/compressed/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,15 @@ static unsigned long get_cmdline_acpi_rsdp(void)
char val[MAX_ADDR_LEN] = { };
int ret;

ret = cmdline_find_option("acpi_rsdp", val, MAX_ADDR_LEN);
ret = cmdline_find_option("acpi_rsdp", val, sizeof(val));
if (ret < 0)
return 0;

if (ret >= sizeof(val)) {
warn("acpi_rsdp= value too long; ignoring");
return 0;
}

if (boot_kstrtoul(val, 16, &addr))
return 0;
#endif
Expand Down
11 changes: 7 additions & 4 deletions arch/x86/boot/early_serial_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static unsigned int probe_baud(int port)
static void parse_console_uart8250(void)
{
char optstr[64], *options;
int baud = DEFAULT_BAUD;
int baud;
int port = 0;

/*
Expand All @@ -136,10 +136,13 @@ static void parse_console_uart8250(void)
else
return;

if (options && (options[0] == ','))
baud = simple_strtoull(options + 1, &options, 0);
else
if (options && (options[0] == ',')) {
baud = simple_strtoull(options + 1, NULL, 0);
if (!baud)
baud = DEFAULT_BAUD;
} else {
baud = probe_baud(port);
}

if (port)
early_serial_init(port, baud);
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/cpu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ obj-$(CONFIG_CPU_SUP_HYGON) += hygon.o
obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o
obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o
obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o
obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o
obj-$(CONFIG_CPU_SUP_ZHAOXIN) += zhaoxin.o
obj-$(CONFIG_CPU_SUP_VORTEX_32) += vortex.o

Expand Down
64 changes: 39 additions & 25 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,14 @@ struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
bio = bio_alloc_percpu_cache(bs);
} else {
opf &= ~REQ_ALLOC_CACHE;
}

/*
* For a bioset without a percpu cache, or when the percpu cache was
* empty, try a slab allocation with optimistic GFP_ flags before
* falling back to the mempool.
*/
if (!bio) {
p = kmem_cache_alloc(bs->bio_slab, gfp);
if (p)
bio = p + bs->front_pad;
Expand Down Expand Up @@ -1191,7 +1199,7 @@ void bio_iov_bvec_set(struct bio *bio, const struct iov_iter *iter)
* for the next iteration.
*/
static int bio_iov_iter_align_down(struct bio *bio, struct iov_iter *iter,
unsigned len_align_mask)
struct bio_vec *bv, unsigned len_align_mask)
{
size_t nbytes = bio->bi_iter.bi_size & len_align_mask;

Expand All @@ -1200,23 +1208,16 @@ static int bio_iov_iter_align_down(struct bio *bio, struct iov_iter *iter,

iov_iter_revert(iter, nbytes);
bio->bi_iter.bi_size -= nbytes;
do {
struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1];

if (nbytes < bv->bv_len) {
bv->bv_len -= nbytes;
break;
}

while (nbytes >= bv->bv_len) {
if (bio_flagged(bio, BIO_PAGE_PINNED))
unpin_user_page(bv->bv_page);

bio->bi_vcnt--;
if (!--bio->bi_vcnt)
return -EFAULT;
nbytes -= bv->bv_len;
} while (nbytes);

if (!bio->bi_vcnt)
return -EFAULT;
bv--;
}
bv->bv_len -= nbytes;
return 0;
}

Expand Down Expand Up @@ -1276,7 +1277,8 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter,

if (is_pci_p2pdma_page(bio->bi_io_vec->bv_page))
bio->bi_opf |= REQ_NOMERGE;
return bio_iov_iter_align_down(bio, iter, len_align_mask);
return bio_iov_iter_align_down(bio, iter,
&bio->bi_io_vec[bio->bi_vcnt - 1], len_align_mask);
}

static struct folio *folio_alloc_greedy(gfp_t gfp, size_t *size,
Expand All @@ -1285,7 +1287,8 @@ static struct folio *folio_alloc_greedy(gfp_t gfp, size_t *size,
struct folio *folio;

while (*size > minsize) {
folio = folio_alloc(gfp | __GFP_NORETRY, get_order(*size));
folio = folio_alloc(gfp | __GFP_NORETRY | __GFP_NOWARN,
get_order(*size));
if (folio)
return folio;
*size = rounddown_pow_of_two(*size - 1);
Expand All @@ -1302,7 +1305,7 @@ static void bio_free_folios(struct bio *bio)
bio_for_each_bvec_all(bv, bio, i) {
struct folio *folio = bvec_folio(bv);

if (!is_zero_folio(folio))
if (!is_zero_folio(folio) && !is_huge_zero_folio(folio))
folio_put(folio);
}
}
Expand Down Expand Up @@ -1360,29 +1363,27 @@ static int bio_iov_iter_bounce_write(struct bio *bio, struct iov_iter *iter,

if (!bio->bi_iter.bi_size)
return -ENOMEM;
return bio_iov_iter_align_down(bio, iter, minsize - 1);
return bio_iov_iter_align_down(bio, iter,
&bio->bi_io_vec[bio->bi_vcnt - 1], minsize - 1);
}

static int bio_iov_iter_bounce_read(struct bio *bio, struct iov_iter *iter,
size_t maxlen, size_t minsize)
{
size_t len = min3(iov_iter_count(iter), maxlen, SZ_1M);
struct folio *folio;
ssize_t ret;

folio = folio_alloc_greedy(GFP_KERNEL, &len, minsize);
if (!folio)
return -ENOMEM;

do {
ssize_t ret;

ret = iov_iter_extract_bvecs(iter, bio->bi_io_vec + 1, len,
&bio->bi_vcnt, bio->bi_max_vecs - 1, 0);
if (ret <= 0) {
if (!bio->bi_vcnt) {
folio_put(folio);
return ret;
}
if (!bio->bi_vcnt)
goto out_folio_put;
break;
}
len -= ret;
Expand All @@ -1398,7 +1399,20 @@ static int bio_iov_iter_bounce_read(struct bio *bio, struct iov_iter *iter,
bvec_set_folio(&bio->bi_io_vec[0], folio, bio->bi_iter.bi_size, 0);
if (iov_iter_extract_will_pin(iter))
bio_set_flag(bio, BIO_PAGE_PINNED);
return bio_iov_iter_align_down(bio, iter, minsize - 1);

/* The first vec stores the bounce buffer, so do not subtract 1 here. */
ret = bio_iov_iter_align_down(bio, iter,
&bio->bi_io_vec[bio->bi_vcnt], minsize - 1);
if (ret)
goto out_folio_put;

/* Update the bounc buffer bv_len to the aligned down size. */
bio->bi_io_vec[0].bv_len = bio->bi_iter.bi_size;
return 0;

out_folio_put:
folio_put(folio);
return ret;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, struct gendisk *disk,
blkg->pd[i]->online = true;
}
}
blkg->online = true;
}
blkg->online = true;
spin_unlock(&blkcg->lock);

if (!ret)
return blkg;

/* @blkg failed fully initialized, use the usual release path */
blkg_put(blkg);
percpu_ref_kill(&blkg->refcnt);
return ERR_PTR(ret);

err_free_blkg:
Expand Down
Loading
Loading