Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Nov 21, 2015
2 parents 707b4f4 + b4a6471 commit 3ad5d7e
Show file tree
Hide file tree
Showing 28 changed files with 283 additions and 111 deletions.
13 changes: 13 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4411,6 +4411,7 @@ K: fmc_d.*register

FPGA MANAGER FRAMEWORK
M: Alan Tull <[email protected]>
R: Moritz Fischer <[email protected]>
S: Maintained
F: drivers/fpga/
F: include/linux/fpga/fpga-mgr.h
Expand Down Expand Up @@ -7904,6 +7905,18 @@ S: Maintained
F: net/openvswitch/
F: include/uapi/linux/openvswitch.h

OPERATING PERFORMANCE POINTS (OPP)
M: Viresh Kumar <[email protected]>
M: Nishanth Menon <[email protected]>
M: Stephen Boyd <[email protected]>
L: [email protected]
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git
F: drivers/base/power/opp/
F: include/linux/pm_opp.h
F: Documentation/power/opp.txt
F: Documentation/devicetree/bindings/opp/

OPL4 DRIVER
M: Clemens Ladisch <[email protected]>
L: [email protected] (moderated for non-subscribers)
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/cx23885/cx23885-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,9 +1992,9 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
(unsigned long long)pci_resource_start(pci_dev, 0));

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

Expand Down
3 changes: 2 additions & 1 deletion drivers/media/pci/cx25821/cx25821-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,8 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
dev->pci_lat, (unsigned long long)dev->base_io_addr);

pci_set_master(pci_dev);
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
err = pci_set_dma_mask(pci_dev, 0xffffffff);
if (err) {
pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO;
goto fail_irq;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/cx88/cx88-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,9 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
return err;
}

if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
err = pci_set_dma_mask(pci,DMA_BIT_MASK(32));
if (err) {
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
err = -EIO;
cx88_core_put(core, pci);
return err;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/pci/cx88/cx88-mpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ static int cx8802_init_common(struct cx8802_dev *dev)
if (pci_enable_device(dev->pci))
return -EIO;
pci_set_master(dev->pci);
if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32));
if (err) {
printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
return -EIO;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,9 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));

pci_set_master(pci_dev);
if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32));
if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
err = -EIO;
goto fail_core;
}
dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/netup_unidvb/netup_unidvb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
"%s(): board vendor 0x%x, revision 0x%x\n",
__func__, board_vendor, board_revision);
pci_set_master(pci_dev);
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
if (pci_set_dma_mask(pci_dev, 0xffffffff) < 0) {
dev_err(&pci_dev->dev,
"%s(): 32bit PCI DMA is not supported\n", __func__);
goto pci_detect_err;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/saa7134/saa7134-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,9 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
pci_set_master(pci_dev);
if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
if (err) {
pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO;
goto fail1;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/saa7164/saa7164-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,9 +1264,9 @@ static int saa7164_initdev(struct pci_dev *pci_dev,

pci_set_master(pci_dev);
/* TODO */
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
err = pci_set_dma_mask(pci_dev, 0xffffffff);
if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO;
goto fail_irq;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/tw68/tw68-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ static int tw68_initdev(struct pci_dev *pci_dev,
dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
dev->pci_lat, (u64)pci_resource_start(pci_dev, 0));
pci_set_master(pci_dev);
if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
if (err) {
pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO;
goto fail1;
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/net/ethernet/amd/pcnet32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,10 +1500,11 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
return -ENODEV;
}

if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
err = pci_set_dma_mask(pdev, PCNET32_DMA_MASK);
if (err) {
if (pcnet32_debug & NETIF_MSG_PROBE)
pr_err("architecture does not support 32bit PCI busmaster DMA\n");
return -ENODEV;
return err;
}
if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {
if (pcnet32_debug & NETIF_MSG_PROBE)
Expand Down
110 changes: 110 additions & 0 deletions fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,116 @@ const struct file_operations configfs_dir_operations = {
.iterate = configfs_readdir,
};

/**
* configfs_register_group - creates a parent-child relation between two groups
* @parent_group: parent group
* @group: child group
*
* link groups, creates dentry for the child and attaches it to the
* parent dentry.
*
* Return: 0 on success, negative errno code on error
*/
int configfs_register_group(struct config_group *parent_group,
struct config_group *group)
{
struct configfs_subsystem *subsys = parent_group->cg_subsys;
struct dentry *parent;
int ret;

mutex_lock(&subsys->su_mutex);
link_group(parent_group, group);
mutex_unlock(&subsys->su_mutex);

parent = parent_group->cg_item.ci_dentry;

mutex_lock_nested(&d_inode(parent)->i_mutex, I_MUTEX_PARENT);
ret = create_default_group(parent_group, group);
if (!ret) {
spin_lock(&configfs_dirent_lock);
configfs_dir_set_ready(group->cg_item.ci_dentry->d_fsdata);
spin_unlock(&configfs_dirent_lock);
}
mutex_unlock(&d_inode(parent)->i_mutex);
return ret;
}
EXPORT_SYMBOL(configfs_register_group);

/**
* configfs_unregister_group() - unregisters a child group from its parent
* @group: parent group to be unregistered
*
* Undoes configfs_register_group()
*/
void configfs_unregister_group(struct config_group *group)
{
struct configfs_subsystem *subsys = group->cg_subsys;
struct dentry *dentry = group->cg_item.ci_dentry;
struct dentry *parent = group->cg_item.ci_parent->ci_dentry;

mutex_lock_nested(&d_inode(parent)->i_mutex, I_MUTEX_PARENT);
spin_lock(&configfs_dirent_lock);
configfs_detach_prep(dentry, NULL);
spin_unlock(&configfs_dirent_lock);

configfs_detach_group(&group->cg_item);
d_inode(dentry)->i_flags |= S_DEAD;
dont_mount(dentry);
d_delete(dentry);
mutex_unlock(&d_inode(parent)->i_mutex);

dput(dentry);

mutex_lock(&subsys->su_mutex);
unlink_group(group);
mutex_unlock(&subsys->su_mutex);
}
EXPORT_SYMBOL(configfs_unregister_group);

/**
* configfs_register_default_group() - allocates and registers a child group
* @parent_group: parent group
* @name: child group name
* @item_type: child item type description
*
* boilerplate to allocate and register a child group with its parent. We need
* kzalloc'ed memory because child's default_group is initially empty.
*
* Return: allocated config group or ERR_PTR() on error
*/
struct config_group *
configfs_register_default_group(struct config_group *parent_group,
const char *name,
struct config_item_type *item_type)
{
int ret;
struct config_group *group;

group = kzalloc(sizeof(*group), GFP_KERNEL);
if (!group)
return ERR_PTR(-ENOMEM);
config_group_init_type_name(group, name, item_type);

ret = configfs_register_group(parent_group, group);
if (ret) {
kfree(group);
return ERR_PTR(ret);
}
return group;
}
EXPORT_SYMBOL(configfs_register_default_group);

/**
* configfs_unregister_default_group() - unregisters and frees a child group
* @group: the group to act on
*/
void configfs_unregister_default_group(struct config_group *group)
{
configfs_unregister_group(group);
kfree(group);
}
EXPORT_SYMBOL(configfs_unregister_default_group);

int configfs_register_subsystem(struct configfs_subsystem *subsys)
{
int err;
Expand Down
16 changes: 11 additions & 5 deletions fs/fat/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ static int __fat_readdir(struct inode *inode, struct file *file,
int status = fat_parse_long(inode, &cpos, &bh, &de,
&unicode, &nr_slots);
if (status < 0) {
ctx->pos = cpos;
bh = NULL;
ret = status;
goto out;
goto end_of_dir;
} else if (status == PARSE_INVALID)
goto record_end;
else if (status == PARSE_NOT_LONGNAME)
Expand Down Expand Up @@ -654,8 +654,9 @@ static int __fat_readdir(struct inode *inode, struct file *file,
fill_len = short_len;

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

if (!memcmp(de->name, MSDOS_DOT, MSDOS_NAME)) {
if (!dir_emit_dot(file, ctx))
Expand All @@ -681,14 +682,19 @@ static int __fat_readdir(struct inode *inode, struct file *file,
fake_offset = 0;
ctx->pos = cpos;
goto get_new;

end_of_dir:
ctx->pos = cpos;
if (fake_offset && cpos < 2)
ctx->pos = 2;
else
ctx->pos = cpos;
fill_failed:
brelse(bh);
if (unicode)
__putname(unicode);
out:
mutex_unlock(&sbi->s_lock);

return ret;
}

Expand Down
Loading

0 comments on commit 3ad5d7e

Please sign in to comment.