Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f00bdce
vdpa: set the virtqueue num during register
jasowang Feb 23, 2021
5808fec
iomap: Fix negative assignment to unsigned sis->pages in iomap_swapfi…
riteshharjani Mar 9, 2021
b5a0842
xfs: fix quota accounting when a mount is idmapped
Mar 2, 2021
da98b54
virtio-mmio: Use to_virtio_mmio_device() to simply code
Feb 22, 2021
bc22ed2
virtio: remove export for virtio_config_{enable, disable}
Feb 20, 2021
aa443ac
vdpa_sim: Skip typecasting from void*
paravmellanox Feb 13, 2021
4c05028
vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
Feb 24, 2021
beb691e
vhost: Fix vhost_vq_reset()
vivier Mar 12, 2021
f6bbf00
vhost-vdpa: fix use-after-free of v->config_ctx
stefano-garzarella Mar 11, 2021
0bde59c
vhost-vdpa: set v->config_ctx to NULL if eventfd_ctx_fdget() fails
stefano-garzarella Mar 11, 2021
d336f7e
xfs: force log and push AIL to clear pinned inodes when aborting mount
Mar 2, 2021
08a2043
docs: ABI: Fix the spelling oustanding to outstanding in the file sys…
unixbhaskar Mar 9, 2021
8723d5b
xfs: also reject BULKSTAT_SINGLE in a mount user namespace
Mar 14, 2021
d2dcc8e
btrfs: fix wrong offset to zero out range beyond i_size
adam900710 Mar 8, 2021
fbf48bb
btrfs: track qgroup released data in own variable in insert_prealloc_…
adam900710 Mar 3, 2021
a3ee79b
btrfs: fix qgroup data rsv leak caused by falloc failure
adam900710 Mar 3, 2021
e3d3b41
btrfs: zoned: fix linked list corruption after log root tree allocati…
fdmanana Mar 11, 2021
d9bb77d
btrfs: subpage: fix wild pointer access during metadata read failure
adam900710 Mar 15, 2021
60484cd
btrfs: subpage: make readahead work properly
adam900710 Mar 15, 2021
7dc4b2f
vfio/type1: fix unmap all on ILP32
Feb 25, 2021
179209f
vfio: IOMMU_API should be selected
jgunthorpe Feb 23, 2021
d3d72a6
vfio-platform: Add COMPILE_TEST to VFIO_PLATFORM
jgunthorpe Feb 23, 2021
3b49dfb
ARM: amba: Allow some ARM_AMBA users to compile with COMPILE_TEST
jgunthorpe Feb 23, 2021
b2b12db
vfio: Depend on MMU
jgunthorpe Mar 5, 2021
4ab4fcf
vfio/type1: fix vaddr_get_pfns() return in vfio_pin_page_external()
danieljordan10 Mar 8, 2021
34e4999
btrfs: fix slab cache flags for free space tree bitmap
kdave Mar 15, 2021
dbcc7d5
btrfs: fix race when cloning extent buffer during rewind of an old root
fdmanana Mar 11, 2021
485df75
btrfs: always pin deleted leaves when there are active tree mod log u…
fdmanana Mar 11, 2021
8ff0f3b
Merge branch 'iomap-5.12-fixes' of git://git.kernel.org/pub/scm/fs/xf…
torvalds Mar 18, 2021
bf152b0
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/gi…
torvalds Mar 18, 2021
c73891c
Merge tag 'xfs-5.12-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/x…
torvalds Mar 18, 2021
dc03379
Merge tag 'vfio-v5.12-rc4' of git://github.com/awilliam/linux-vfio
torvalds Mar 18, 2021
81aa096
Merge tag 'for-5.12-rc3-tag' of git://git.kernel.org/pub/scm/linux/ke…
torvalds Mar 18, 2021
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
2 changes: 1 addition & 1 deletion Documentation/ABI/testing/sysfs-fs-xfs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Contact: xfs@oss.sgi.com
Description:
The current state of the log write grant head. It
represents the total log reservation of all currently
oustanding transactions, including regrants due to
outstanding transactions, including regrants due to
rolling transactions. The grant head is exported in
"cycle:bytes" format.
Users: xfstests
5 changes: 2 additions & 3 deletions drivers/vdpa/ifcvf/ifcvf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
}

adapter = vdpa_alloc_device(struct ifcvf_adapter, vdpa,
dev, &ifc_vdpa_ops,
IFCVF_MAX_QUEUE_PAIRS * 2, NULL);
dev, &ifc_vdpa_ops, NULL);
if (adapter == NULL) {
IFCVF_ERR(pdev, "Failed to allocate vDPA structure");
return -ENOMEM;
Expand All @@ -456,7 +455,7 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++)
vf->vring[i].irq = -EINVAL;

ret = vdpa_register_device(&adapter->vdpa);
ret = vdpa_register_device(&adapter->vdpa, IFCVF_MAX_QUEUE_PAIRS * 2);
if (ret) {
IFCVF_ERR(pdev, "Failed to register ifcvf to vdpa bus");
goto err;
Expand Down
4 changes: 2 additions & 2 deletions drivers/vdpa/mlx5/net/mlx5_vnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ static int mlx5v_probe(struct auxiliary_device *adev,
max_vqs = min_t(u32, max_vqs, MLX5_MAX_SUPPORTED_VQS);

ndev = vdpa_alloc_device(struct mlx5_vdpa_net, mvdev.vdev, mdev->device, &mlx5_vdpa_ops,
2 * mlx5_vdpa_max_qps(max_vqs), NULL);
NULL);
if (IS_ERR(ndev))
return PTR_ERR(ndev);

Expand All @@ -2009,7 +2009,7 @@ static int mlx5v_probe(struct auxiliary_device *adev,
if (err)
goto err_res;

err = vdpa_register_device(&mvdev->vdev);
err = vdpa_register_device(&mvdev->vdev, 2 * mlx5_vdpa_max_qps(max_vqs));
if (err)
goto err_reg;

Expand Down
18 changes: 10 additions & 8 deletions drivers/vdpa/vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ static void vdpa_release_dev(struct device *d)
* initialized but before registered.
* @parent: the parent device
* @config: the bus operations that is supported by this device
* @nvqs: number of virtqueues supported by this device
* @size: size of the parent structure that contains private data
* @name: name of the vdpa device; optional.
*
Expand All @@ -81,7 +80,7 @@ static void vdpa_release_dev(struct device *d)
*/
struct vdpa_device *__vdpa_alloc_device(struct device *parent,
const struct vdpa_config_ops *config,
int nvqs, size_t size, const char *name)
size_t size, const char *name)
{
struct vdpa_device *vdev;
int err = -EINVAL;
Expand All @@ -107,7 +106,6 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent,
vdev->index = err;
vdev->config = config;
vdev->features_valid = false;
vdev->nvqs = nvqs;

if (name)
err = dev_set_name(&vdev->dev, "%s", name);
Expand Down Expand Up @@ -136,10 +134,12 @@ static int vdpa_name_match(struct device *dev, const void *data)
return (strcmp(dev_name(&vdev->dev), data) == 0);
}

static int __vdpa_register_device(struct vdpa_device *vdev)
static int __vdpa_register_device(struct vdpa_device *vdev, int nvqs)
{
struct device *dev;

vdev->nvqs = nvqs;

lockdep_assert_held(&vdpa_dev_mutex);
dev = bus_find_device(&vdpa_bus, NULL, dev_name(&vdev->dev), vdpa_name_match);
if (dev) {
Expand All @@ -155,31 +155,33 @@ static int __vdpa_register_device(struct vdpa_device *vdev)
* Caller must invoke this routine in the management device dev_add()
* callback after setting up valid mgmtdev for this vdpa device.
* @vdev: the vdpa device to be registered to vDPA bus
* @nvqs: number of virtqueues supported by this device
*
* Returns an error when fail to add device to vDPA bus
*/
int _vdpa_register_device(struct vdpa_device *vdev)
int _vdpa_register_device(struct vdpa_device *vdev, int nvqs)
{
if (!vdev->mdev)
return -EINVAL;

return __vdpa_register_device(vdev);
return __vdpa_register_device(vdev, nvqs);
}
EXPORT_SYMBOL_GPL(_vdpa_register_device);

/**
* vdpa_register_device - register a vDPA device
* Callers must have a succeed call of vdpa_alloc_device() before.
* @vdev: the vdpa device to be registered to vDPA bus
* @nvqs: number of virtqueues supported by this device
*
* Returns an error when fail to add to vDPA bus
*/
int vdpa_register_device(struct vdpa_device *vdev)
int vdpa_register_device(struct vdpa_device *vdev, int nvqs)
{
int err;

mutex_lock(&vdpa_dev_mutex);
err = __vdpa_register_device(vdev);
err = __vdpa_register_device(vdev, nvqs);
mutex_unlock(&vdpa_dev_mutex);
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/vdpa/vdpa_sim/vdpa_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *dev_attr)
ops = &vdpasim_config_ops;

vdpasim = vdpa_alloc_device(struct vdpasim, vdpa, NULL, ops,
dev_attr->nvqs, dev_attr->name);
dev_attr->name);
if (!vdpasim)
goto err_alloc;

Expand Down
5 changes: 2 additions & 3 deletions drivers/vdpa/vdpa_sim/vdpa_sim_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ static void vdpasim_net_work(struct work_struct *work)

static void vdpasim_net_get_config(struct vdpasim *vdpasim, void *config)
{
struct virtio_net_config *net_config =
(struct virtio_net_config *)config;
struct virtio_net_config *net_config = config;

net_config->mtu = cpu_to_vdpasim16(vdpasim, 1500);
net_config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP);
Expand Down Expand Up @@ -147,7 +146,7 @@ static int vdpasim_net_dev_add(struct vdpa_mgmt_dev *mdev, const char *name)
if (IS_ERR(simdev))
return PTR_ERR(simdev);

ret = _vdpa_register_device(&simdev->vdpa);
ret = _vdpa_register_device(&simdev->vdpa, VDPASIM_NET_VQ_NUM);
if (ret)
goto reg_err;

Expand Down
4 changes: 2 additions & 2 deletions drivers/vfio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ config VFIO_VIRQFD

menuconfig VFIO
tristate "VFIO Non-Privileged userspace driver framework"
depends on IOMMU_API
select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64)
select IOMMU_API
select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64)
help
VFIO provides a framework for secure userspace device drivers.
See Documentation/driver-api/vfio.rst for more details.
Expand Down
4 changes: 2 additions & 2 deletions drivers/vfio/platform/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
config VFIO_PLATFORM
tristate "VFIO support for platform devices"
depends on VFIO && EVENTFD && (ARM || ARM64)
depends on VFIO && EVENTFD && (ARM || ARM64 || COMPILE_TEST)
select VFIO_VIRQFD
help
Support for platform devices with VFIO. This is required to make
Expand All @@ -12,7 +12,7 @@ config VFIO_PLATFORM

config VFIO_AMBA
tristate "VFIO support for AMBA devices"
depends on VFIO_PLATFORM && ARM_AMBA
depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST)
help
Support for ARM AMBA devices with VFIO. This is required to make
use of ARM AMBA devices present on the system using the VFIO
Expand Down
20 changes: 12 additions & 8 deletions drivers/vfio/vfio_iommu_type1.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static struct vfio_dma *vfio_find_dma(struct vfio_iommu *iommu,
}

static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu,
dma_addr_t start, size_t size)
dma_addr_t start, u64 size)
{
struct rb_node *res = NULL;
struct rb_node *node = iommu->dma_list.rb_node;
Expand Down Expand Up @@ -785,7 +785,12 @@ static int vfio_pin_page_external(struct vfio_dma *dma, unsigned long vaddr,
return -ENODEV;

ret = vaddr_get_pfns(mm, vaddr, 1, dma->prot, pfn_base, pages);
if (ret == 1 && do_accounting && !is_invalid_reserved_pfn(*pfn_base)) {
if (ret != 1)
goto out;

ret = 0;

if (do_accounting && !is_invalid_reserved_pfn(*pfn_base)) {
ret = vfio_lock_acct(dma, 1, true);
if (ret) {
put_pfn(*pfn_base, dma->prot);
Expand All @@ -797,6 +802,7 @@ static int vfio_pin_page_external(struct vfio_dma *dma, unsigned long vaddr,
}
}

out:
mmput(mm);
return ret;
}
Expand Down Expand Up @@ -1288,7 +1294,7 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu,
int ret = -EINVAL, retries = 0;
unsigned long pgshift;
dma_addr_t iova = unmap->iova;
unsigned long size = unmap->size;
u64 size = unmap->size;
bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL;
bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR;
struct rb_node *n, *first_n;
Expand All @@ -1304,14 +1310,12 @@ static int vfio_dma_do_unmap(struct vfio_iommu *iommu,
if (unmap_all) {
if (iova || size)
goto unlock;
size = SIZE_MAX;
} else if (!size || size & (pgsize - 1)) {
size = U64_MAX;
} else if (!size || size & (pgsize - 1) ||
iova + size - 1 < iova || size > SIZE_MAX) {
goto unlock;
}

if (iova + size - 1 < iova || size > SIZE_MAX)
goto unlock;

/* When dirty tracking is enabled, allow only min supported pgsize */
if ((unmap->flags & VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP) &&
(!iommu->dirty_page_tracking || (bitmap->pgsize != pgsize))) {
Expand Down
20 changes: 11 additions & 9 deletions drivers/vhost/vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ static long vhost_vdpa_get_vring_num(struct vhost_vdpa *v, u16 __user *argp)

static void vhost_vdpa_config_put(struct vhost_vdpa *v)
{
if (v->config_ctx)
if (v->config_ctx) {
eventfd_ctx_put(v->config_ctx);
v->config_ctx = NULL;
}
}

static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
Expand All @@ -329,8 +331,12 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
if (!IS_ERR_OR_NULL(ctx))
eventfd_ctx_put(ctx);

if (IS_ERR(v->config_ctx))
return PTR_ERR(v->config_ctx);
if (IS_ERR(v->config_ctx)) {
long ret = PTR_ERR(v->config_ctx);

v->config_ctx = NULL;
return ret;
}

v->vdpa->config->set_config_cb(v->vdpa, &cb);

Expand Down Expand Up @@ -900,14 +906,10 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)

static void vhost_vdpa_clean_irq(struct vhost_vdpa *v)
{
struct vhost_virtqueue *vq;
int i;

for (i = 0; i < v->nvqs; i++) {
vq = &v->vqs[i];
if (vq->call_ctx.producer.irq)
irq_bypass_unregister_producer(&vq->call_ctx.producer);
}
for (i = 0; i < v->nvqs; i++)
vhost_vdpa_unsetup_vq_irq(v, i);
}

static int vhost_vdpa_release(struct inode *inode, struct file *filep)
Expand Down
2 changes: 1 addition & 1 deletion drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ static void vhost_vq_reset(struct vhost_dev *dev,
vq->error_ctx = NULL;
vq->kick = NULL;
vq->log_ctx = NULL;
vhost_reset_is_le(vq);
vhost_disable_cross_endian(vq);
vhost_reset_is_le(vq);
vq->busyloop_timeout = 0;
vq->umem = NULL;
vq->iotlb = NULL;
Expand Down
6 changes: 2 additions & 4 deletions drivers/virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,14 @@ void virtio_config_changed(struct virtio_device *dev)
}
EXPORT_SYMBOL_GPL(virtio_config_changed);

void virtio_config_disable(struct virtio_device *dev)
static void virtio_config_disable(struct virtio_device *dev)
{
spin_lock_irq(&dev->config_lock);
dev->config_enabled = false;
spin_unlock_irq(&dev->config_lock);
}
EXPORT_SYMBOL_GPL(virtio_config_disable);

void virtio_config_enable(struct virtio_device *dev)
static void virtio_config_enable(struct virtio_device *dev)
{
spin_lock_irq(&dev->config_lock);
dev->config_enabled = true;
Expand All @@ -158,7 +157,6 @@ void virtio_config_enable(struct virtio_device *dev)
dev->config_change_pending = false;
spin_unlock_irq(&dev->config_lock);
}
EXPORT_SYMBOL_GPL(virtio_config_enable);

void virtio_add_status(struct virtio_device *dev, unsigned int status)
{
Expand Down
3 changes: 1 addition & 2 deletions drivers/virtio/virtio_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,7 @@ static void virtio_mmio_release_dev(struct device *_d)
{
struct virtio_device *vdev =
container_of(_d, struct virtio_device, dev);
struct virtio_mmio_device *vm_dev =
container_of(vdev, struct virtio_mmio_device, vdev);
struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
struct platform_device *pdev = vm_dev->pdev;

devm_kfree(&pdev->dev, vm_dev);
Expand Down
2 changes: 2 additions & 0 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,9 @@ get_old_root(struct btrfs_root *root, u64 time_seq)
"failed to read tree block %llu from get_old_root",
logical);
} else {
btrfs_tree_read_lock(old);
eb = btrfs_clone_extent_buffer(old);
btrfs_tree_read_unlock(old);
free_extent_buffer(old);
}
} else if (old_root) {
Expand Down
23 changes: 22 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3323,6 +3323,7 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans,

if (last_ref && btrfs_header_generation(buf) == trans->transid) {
struct btrfs_block_group *cache;
bool must_pin = false;

if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {
ret = check_ref_cleanup(trans, buf->start);
Expand All @@ -3340,7 +3341,27 @@ void btrfs_free_tree_block(struct btrfs_trans_handle *trans,
goto out;
}

if (btrfs_is_zoned(fs_info)) {
/*
* If this is a leaf and there are tree mod log users, we may
* have recorded mod log operations that point to this leaf.
* So we must make sure no one reuses this leaf's extent before
* mod log operations are applied to a node, otherwise after
* rewinding a node using the mod log operations we get an
* inconsistent btree, as the leaf's extent may now be used as
* a node or leaf for another different btree.
* We are safe from races here because at this point no other
* node or root points to this extent buffer, so if after this
* check a new tree mod log user joins, it will not be able to
* find a node pointing to this leaf and record operations that
* point to this leaf.
*/
if (btrfs_header_level(buf) == 0) {
read_lock(&fs_info->tree_mod_log_lock);
must_pin = !list_empty(&fs_info->tree_mod_seq_list);
read_unlock(&fs_info->tree_mod_log_lock);
}

if (must_pin || btrfs_is_zoned(fs_info)) {
btrfs_redirty_list_add(trans->transaction, buf);
pin_down_extent(trans, cache, buf->start, buf->len, 1);
btrfs_put_block_group(cache);
Expand Down
Loading