Skip to content

Commit 3ad5d7e

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "A bunch of fixes" * emailed patches from Andrew Morton <[email protected]>: slub: mark the dangling ifdef #else of CONFIG_SLUB_DEBUG slub: avoid irqoff/on in bulk allocation slub: create new ___slab_alloc function that can be called with irqs disabled mm: fix up sparse warning in gfpflags_allow_blocking ocfs2: fix umask ignored issue PM/OPP: add entry in MAINTAINERS kernel/panic.c: turn off locks debug before releasing console lock kernel/signal.c: unexport sigsuspend() kasan: fix kmemleak false-positive in kasan_module_alloc() fat: fix fake_offset handling on error path mm/hugetlbfs: fix bugs in fallocate hole punch of areas with holes mm/page-writeback.c: initialize m_dirty to avoid compile warning various: fix pci_set_dma_mask return value checking mm: loosen MADV_NOHUGEPAGE to enable Qemu postcopy on s390 mm: vmalloc: don't remove inexistent guard hole in remove_vm_area() tools/vm/page-types.c: support KPF_IDLE ncpfs: don't allow negative timeouts configfs: allow dynamic group creation MAINTAINERS: add Moritz as reviewer for FPGA Manager Framework slab.h: sprinkle __assume_aligned attributes
2 parents 707b4f4 + b4a6471 commit 3ad5d7e

File tree

28 files changed

+283
-111
lines changed

28 files changed

+283
-111
lines changed

MAINTAINERS

+13
Original file line numberDiff line numberDiff line change
@@ -4411,6 +4411,7 @@ K: fmc_d.*register
44114411

44124412
FPGA MANAGER FRAMEWORK
44134413
M: Alan Tull <[email protected]>
4414+
R: Moritz Fischer <[email protected]>
44144415
S: Maintained
44154416
F: drivers/fpga/
44164417
F: include/linux/fpga/fpga-mgr.h
@@ -7904,6 +7905,18 @@ S: Maintained
79047905
F: net/openvswitch/
79057906
F: include/uapi/linux/openvswitch.h
79067907

7908+
OPERATING PERFORMANCE POINTS (OPP)
7909+
M: Viresh Kumar <[email protected]>
7910+
M: Nishanth Menon <[email protected]>
7911+
M: Stephen Boyd <[email protected]>
7912+
7913+
S: Maintained
7914+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git
7915+
F: drivers/base/power/opp/
7916+
F: include/linux/pm_opp.h
7917+
F: Documentation/power/opp.txt
7918+
F: Documentation/devicetree/bindings/opp/
7919+
79077920
OPL4 DRIVER
79087921
M: Clemens Ladisch <[email protected]>
79097922
L: [email protected] (moderated for non-subscribers)

drivers/media/pci/cx23885/cx23885-core.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1992,9 +1992,9 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
19921992
(unsigned long long)pci_resource_start(pci_dev, 0));
19931993

19941994
pci_set_master(pci_dev);
1995-
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
1995+
err = pci_set_dma_mask(pci_dev, 0xffffffff);
1996+
if (err) {
19961997
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
1997-
err = -EIO;
19981998
goto fail_context;
19991999
}
20002000

drivers/media/pci/cx25821/cx25821-core.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,8 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
13191319
dev->pci_lat, (unsigned long long)dev->base_io_addr);
13201320

13211321
pci_set_master(pci_dev);
1322-
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
1322+
err = pci_set_dma_mask(pci_dev, 0xffffffff);
1323+
if (err) {
13231324
pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
13241325
err = -EIO;
13251326
goto fail_irq;

drivers/media/pci/cx88/cx88-alsa.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -890,9 +890,9 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
890890
return err;
891891
}
892892

893-
if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
893+
err = pci_set_dma_mask(pci,DMA_BIT_MASK(32));
894+
if (err) {
894895
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
895-
err = -EIO;
896896
cx88_core_put(core, pci);
897897
return err;
898898
}

drivers/media/pci/cx88/cx88-mpeg.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ static int cx8802_init_common(struct cx8802_dev *dev)
393393
if (pci_enable_device(dev->pci))
394394
return -EIO;
395395
pci_set_master(dev->pci);
396-
if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
396+
err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32));
397+
if (err) {
397398
printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
398399
return -EIO;
399400
}

drivers/media/pci/cx88/cx88-video.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1314,9 +1314,9 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
13141314
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
13151315

13161316
pci_set_master(pci_dev);
1317-
if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
1317+
err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32));
1318+
if (err) {
13181319
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
1319-
err = -EIO;
13201320
goto fail_core;
13211321
}
13221322
dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);

drivers/media/pci/netup_unidvb/netup_unidvb_core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
810810
"%s(): board vendor 0x%x, revision 0x%x\n",
811811
__func__, board_vendor, board_revision);
812812
pci_set_master(pci_dev);
813-
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
813+
if (pci_set_dma_mask(pci_dev, 0xffffffff) < 0) {
814814
dev_err(&pci_dev->dev,
815815
"%s(): 32bit PCI DMA is not supported\n", __func__);
816816
goto pci_detect_err;

drivers/media/pci/saa7134/saa7134-core.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,9 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
951951
pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
952952
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
953953
pci_set_master(pci_dev);
954-
if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
954+
err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
955+
if (err) {
955956
pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
956-
err = -EIO;
957957
goto fail1;
958958
}
959959

drivers/media/pci/saa7164/saa7164-core.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1264,9 +1264,9 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
12641264

12651265
pci_set_master(pci_dev);
12661266
/* TODO */
1267-
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
1267+
err = pci_set_dma_mask(pci_dev, 0xffffffff);
1268+
if (err) {
12681269
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
1269-
err = -EIO;
12701270
goto fail_irq;
12711271
}
12721272

drivers/media/pci/tw68/tw68-core.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ static int tw68_initdev(struct pci_dev *pci_dev,
257257
dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
258258
dev->pci_lat, (u64)pci_resource_start(pci_dev, 0));
259259
pci_set_master(pci_dev);
260-
if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
260+
err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
261+
if (err) {
261262
pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
262-
err = -EIO;
263263
goto fail1;
264264
}
265265

drivers/net/ethernet/amd/pcnet32.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1500,10 +1500,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
15001500
return -ENODEV;
15011501
}
15021502

1503-
if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
1503+
err = pci_set_dma_mask(pdev, PCNET32_DMA_MASK);
1504+
if (err) {
15041505
if (pcnet32_debug & NETIF_MSG_PROBE)
15051506
pr_err("architecture does not support 32bit PCI busmaster DMA\n");
1506-
return -ENODEV;
1507+
return err;
15071508
}
15081509
if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {
15091510
if (pcnet32_debug & NETIF_MSG_PROBE)

fs/configfs/dir.c

+110
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,116 @@ const struct file_operations configfs_dir_operations = {
16361636
.iterate = configfs_readdir,
16371637
};
16381638

1639+
/**
1640+
* configfs_register_group - creates a parent-child relation between two groups
1641+
* @parent_group: parent group
1642+
* @group: child group
1643+
*
1644+
* link groups, creates dentry for the child and attaches it to the
1645+
* parent dentry.
1646+
*
1647+
* Return: 0 on success, negative errno code on error
1648+
*/
1649+
int configfs_register_group(struct config_group *parent_group,
1650+
struct config_group *group)
1651+
{
1652+
struct configfs_subsystem *subsys = parent_group->cg_subsys;
1653+
struct dentry *parent;
1654+
int ret;
1655+
1656+
mutex_lock(&subsys->su_mutex);
1657+
link_group(parent_group, group);
1658+
mutex_unlock(&subsys->su_mutex);
1659+
1660+
parent = parent_group->cg_item.ci_dentry;
1661+
1662+
mutex_lock_nested(&d_inode(parent)->i_mutex, I_MUTEX_PARENT);
1663+
ret = create_default_group(parent_group, group);
1664+
if (!ret) {
1665+
spin_lock(&configfs_dirent_lock);
1666+
configfs_dir_set_ready(group->cg_item.ci_dentry->d_fsdata);
1667+
spin_unlock(&configfs_dirent_lock);
1668+
}
1669+
mutex_unlock(&d_inode(parent)->i_mutex);
1670+
return ret;
1671+
}
1672+
EXPORT_SYMBOL(configfs_register_group);
1673+
1674+
/**
1675+
* configfs_unregister_group() - unregisters a child group from its parent
1676+
* @group: parent group to be unregistered
1677+
*
1678+
* Undoes configfs_register_group()
1679+
*/
1680+
void configfs_unregister_group(struct config_group *group)
1681+
{
1682+
struct configfs_subsystem *subsys = group->cg_subsys;
1683+
struct dentry *dentry = group->cg_item.ci_dentry;
1684+
struct dentry *parent = group->cg_item.ci_parent->ci_dentry;
1685+
1686+
mutex_lock_nested(&d_inode(parent)->i_mutex, I_MUTEX_PARENT);
1687+
spin_lock(&configfs_dirent_lock);
1688+
configfs_detach_prep(dentry, NULL);
1689+
spin_unlock(&configfs_dirent_lock);
1690+
1691+
configfs_detach_group(&group->cg_item);
1692+
d_inode(dentry)->i_flags |= S_DEAD;
1693+
dont_mount(dentry);
1694+
d_delete(dentry);
1695+
mutex_unlock(&d_inode(parent)->i_mutex);
1696+
1697+
dput(dentry);
1698+
1699+
mutex_lock(&subsys->su_mutex);
1700+
unlink_group(group);
1701+
mutex_unlock(&subsys->su_mutex);
1702+
}
1703+
EXPORT_SYMBOL(configfs_unregister_group);
1704+
1705+
/**
1706+
* configfs_register_default_group() - allocates and registers a child group
1707+
* @parent_group: parent group
1708+
* @name: child group name
1709+
* @item_type: child item type description
1710+
*
1711+
* boilerplate to allocate and register a child group with its parent. We need
1712+
* kzalloc'ed memory because child's default_group is initially empty.
1713+
*
1714+
* Return: allocated config group or ERR_PTR() on error
1715+
*/
1716+
struct config_group *
1717+
configfs_register_default_group(struct config_group *parent_group,
1718+
const char *name,
1719+
struct config_item_type *item_type)
1720+
{
1721+
int ret;
1722+
struct config_group *group;
1723+
1724+
group = kzalloc(sizeof(*group), GFP_KERNEL);
1725+
if (!group)
1726+
return ERR_PTR(-ENOMEM);
1727+
config_group_init_type_name(group, name, item_type);
1728+
1729+
ret = configfs_register_group(parent_group, group);
1730+
if (ret) {
1731+
kfree(group);
1732+
return ERR_PTR(ret);
1733+
}
1734+
return group;
1735+
}
1736+
EXPORT_SYMBOL(configfs_register_default_group);
1737+
1738+
/**
1739+
* configfs_unregister_default_group() - unregisters and frees a child group
1740+
* @group: the group to act on
1741+
*/
1742+
void configfs_unregister_default_group(struct config_group *group)
1743+
{
1744+
configfs_unregister_group(group);
1745+
kfree(group);
1746+
}
1747+
EXPORT_SYMBOL(configfs_unregister_default_group);
1748+
16391749
int configfs_register_subsystem(struct configfs_subsystem *subsys)
16401750
{
16411751
int err;

fs/fat/dir.c

+11-5
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,9 @@ static int __fat_readdir(struct inode *inode, struct file *file,
610610
int status = fat_parse_long(inode, &cpos, &bh, &de,
611611
&unicode, &nr_slots);
612612
if (status < 0) {
613-
ctx->pos = cpos;
613+
bh = NULL;
614614
ret = status;
615-
goto out;
615+
goto end_of_dir;
616616
} else if (status == PARSE_INVALID)
617617
goto record_end;
618618
else if (status == PARSE_NOT_LONGNAME)
@@ -654,8 +654,9 @@ static int __fat_readdir(struct inode *inode, struct file *file,
654654
fill_len = short_len;
655655

656656
start_filldir:
657-
if (!fake_offset)
658-
ctx->pos = cpos - (nr_slots + 1) * sizeof(struct msdos_dir_entry);
657+
ctx->pos = cpos - (nr_slots + 1) * sizeof(struct msdos_dir_entry);
658+
if (fake_offset && ctx->pos < 2)
659+
ctx->pos = 2;
659660

660661
if (!memcmp(de->name, MSDOS_DOT, MSDOS_NAME)) {
661662
if (!dir_emit_dot(file, ctx))
@@ -681,14 +682,19 @@ static int __fat_readdir(struct inode *inode, struct file *file,
681682
fake_offset = 0;
682683
ctx->pos = cpos;
683684
goto get_new;
685+
684686
end_of_dir:
685-
ctx->pos = cpos;
687+
if (fake_offset && cpos < 2)
688+
ctx->pos = 2;
689+
else
690+
ctx->pos = cpos;
686691
fill_failed:
687692
brelse(bh);
688693
if (unicode)
689694
__putname(unicode);
690695
out:
691696
mutex_unlock(&sbi->s_lock);
697+
692698
return ret;
693699
}
694700

0 commit comments

Comments
 (0)