Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion drivers/dma-buf/udmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,23 @@ static struct miscdevice udmabuf_misc = {

static int __init udmabuf_dev_init(void)
{
return misc_register(&udmabuf_misc);
int ret;

ret = misc_register(&udmabuf_misc);
if (ret < 0) {
pr_err("Could not initialize udmabuf device\n");
return ret;
}

ret = dma_coerce_mask_and_coherent(udmabuf_misc.this_device,
DMA_BIT_MASK(64));
if (ret < 0) {
pr_err("Could not setup DMA mask for udmabuf device\n");
misc_deregister(&udmabuf_misc);
return ret;
}

return 0;
}

static void __exit udmabuf_dev_exit(void)
Expand Down
7 changes: 4 additions & 3 deletions drivers/infiniband/sw/siw/siw_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ static int siw_proc_mpareply(struct siw_cep *cep)
enum mpa_v2_ctrl mpa_p2p_mode = MPA_V2_RDMA_NO_RTR;

rv = siw_recv_mpa_rr(cep);
if (rv != -EAGAIN)
siw_cancel_mpatimer(cep);
if (rv)
goto out_err;

siw_cancel_mpatimer(cep);

rep = &cep->mpa.hdr;

if (__mpa_rr_revision(rep->params.bits) > MPA_REVISION_2) {
Expand Down Expand Up @@ -895,7 +895,8 @@ static int siw_proc_mpareply(struct siw_cep *cep)
}

out_err:
siw_cm_upcall(cep, IW_CM_EVENT_CONNECT_REPLY, -EINVAL);
if (rv != -EAGAIN)
siw_cm_upcall(cep, IW_CM_EVENT_CONNECT_REPLY, -EINVAL);

return rv;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2904,10 +2904,10 @@ static void raid5_end_write_request(struct bio *bi)
if (!test_and_clear_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags))
clear_bit(R5_LOCKED, &sh->dev[i].flags);
set_bit(STRIPE_HANDLE, &sh->state);
raid5_release_stripe(sh);

if (sh->batch_head && sh != sh->batch_head)
raid5_release_stripe(sh->batch_head);
raid5_release_stripe(sh);
}

static void raid5_error(struct mddev *mddev, struct md_rdev *rdev)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ static void intel_eth_pci_remove(struct pci_dev *pdev)

stmmac_dvr_remove(&pdev->dev);

clk_disable_unprepare(priv->plat->stmmac_clk);
clk_unregister_fixed_rate(priv->plat->stmmac_clk);

pcim_iounmap_regions(pdev, BIT(0));
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ static int storvsc_probe(struct hv_device *device,
*/
host_dev->handle_error_wq =
alloc_ordered_workqueue("storvsc_error_wq_%d",
WQ_MEM_RECLAIM,
0,
host->host_no);
if (!host_dev->handle_error_wq) {
ret = -ENOMEM;
Expand Down
8 changes: 7 additions & 1 deletion drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2998,9 +2998,15 @@ EXPORT_SYMBOL_GPL(usb_add_hcd);
*/
void usb_remove_hcd(struct usb_hcd *hcd)
{
struct usb_device *rhdev = hcd->self.root_hub;
struct usb_device *rhdev;
bool rh_registered;

if (!hcd) {
pr_debug("%s: hcd is NULL\n", __func__);
return;
}
rhdev = hcd->self.root_hub;

dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);

usb_get_dev(rhdev);
Expand Down
10 changes: 10 additions & 0 deletions fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,16 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
}
brelse(bh);

/*
* For bigalloc, trim the requested size to the nearest cluster
* boundary to avoid creating an unusable filesystem. We do this
* silently, instead of returning an error, to avoid breaking
* callers that blindly resize the filesystem to the full size of
* the underlying block device.
*/
if (ext4_has_feature_bigalloc(sb))
n_blocks_count &= ~((1 << EXT4_CLUSTER_BITS(sb)) - 1);

retry:
o_blocks_count = ext4_blocks_count(es);

Expand Down
13 changes: 13 additions & 0 deletions fs/ext4/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ struct ext4_xattr_entry {

#define EXT4_ZERO_XATTR_VALUE ((void *)-1)

/*
* If we want to add an xattr to the inode, we should make sure that
* i_extra_isize is not 0 and that the inode size is not less than
* EXT4_GOOD_OLD_INODE_SIZE + extra_isize + pad.
* EXT4_GOOD_OLD_INODE_SIZE extra_isize header entry pad data
* |--------------------------|------------|------|---------|---|-------|
*/
#define EXT4_INODE_HAS_XATTR_SPACE(inode) \
((EXT4_I(inode)->i_extra_isize != 0) && \
(EXT4_GOOD_OLD_INODE_SIZE + EXT4_I(inode)->i_extra_isize + \
sizeof(struct ext4_xattr_ibody_header) + EXT4_XATTR_PAD <= \
EXT4_INODE_SIZE((inode)->i_sb)))

struct ext4_xattr_info {
const char *name;
const void *value;
Expand Down
10 changes: 4 additions & 6 deletions kernel/bpf/verifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -5893,8 +5893,7 @@ record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta,
struct bpf_insn_aux_data *aux = &env->insn_aux_data[insn_idx];
struct bpf_reg_state *regs = cur_regs(env), *reg;
struct bpf_map *map = meta->map_ptr;
struct tnum range;
u64 val;
u64 val, max;
int err;

if (func_id != BPF_FUNC_tail_call)
Expand All @@ -5904,19 +5903,18 @@ record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta,
return -EINVAL;
}

range = tnum_range(0, map->max_entries - 1);
reg = &regs[BPF_REG_3];
val = reg->var_off.value;
max = map->max_entries;

if (!register_is_const(reg) || !tnum_in(range, reg->var_off)) {
if (!(register_is_const(reg) && val < max)) {
bpf_map_key_store(aux, BPF_MAP_KEY_POISON);
return 0;
}

err = mark_chain_precision(env, BPF_REG_3);
if (err)
return err;

val = reg->var_off.value;
if (bpf_map_key_unseen(aux))
bpf_map_key_store(aux, val);
else if (!bpf_map_key_poisoned(aux) &&
Expand Down
8 changes: 7 additions & 1 deletion net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,9 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk,
info->limit > dfrag->data_len))
return 0;

if (unlikely(!__tcp_can_send(ssk)))
return -EAGAIN;

/* compute send limit */
info->mss_now = tcp_send_mss(ssk, &info->size_goal, info->flags);
copy = info->size_goal;
Expand Down Expand Up @@ -1445,7 +1448,8 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
if (__mptcp_check_fallback(msk)) {
if (!msk->first)
return NULL;
return sk_stream_memory_free(msk->first) ? msk->first : NULL;
return __tcp_can_send(msk->first) &&
sk_stream_memory_free(msk->first) ? msk->first : NULL;
}

/* re-use last subflow, if the burst allow that */
Expand Down Expand Up @@ -1570,6 +1574,8 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)

ret = mptcp_sendmsg_frag(sk, ssk, dfrag, &info);
if (ret <= 0) {
if (ret == -EAGAIN)
continue;
mptcp_push_release(ssk, &info);
goto out;
}
Expand Down
11 changes: 7 additions & 4 deletions net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,16 +565,19 @@ void mptcp_info2sockaddr(const struct mptcp_addr_info *info,
struct sockaddr_storage *addr,
unsigned short family);

static inline bool __mptcp_subflow_active(struct mptcp_subflow_context *subflow)
static inline bool __tcp_can_send(const struct sock *ssk)
{
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
/* only send if our side has not closed yet */
return ((1 << inet_sk_state_load(ssk)) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT));
}

static inline bool __mptcp_subflow_active(struct mptcp_subflow_context *subflow)
{
/* can't send if JOIN hasn't completed yet (i.e. is usable for mptcp) */
if (subflow->request_join && !subflow->fully_established)
return false;

/* only send if our side has not closed yet */
return ((1 << ssk->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT));
return __tcp_can_send(mptcp_subflow_tcp_sock(subflow));
}

void mptcp_subflow_set_active(struct mptcp_subflow_context *subflow);
Expand Down
12 changes: 7 additions & 5 deletions net/qrtr/mhi.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev,
struct qrtr_mhi_dev *qdev;
int rc;

/* start channels */
rc = mhi_prepare_for_transfer_autoqueue(mhi_dev);
if (rc)
return rc;

qdev = devm_kzalloc(&mhi_dev->dev, sizeof(*qdev), GFP_KERNEL);
if (!qdev)
return -ENOMEM;
Expand All @@ -96,6 +91,13 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev,
if (rc)
return rc;

/* start channels */
rc = mhi_prepare_for_transfer_autoqueue(mhi_dev);
if (rc) {
qrtr_endpoint_unregister(&qdev->ep);
return rc;
}

dev_dbg(qdev->dev, "Qualcomm MHI QRTR driver probed\n");

return 0;
Expand Down