Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234107
b: refs/heads/master
c: 786c58b
h: refs/heads/master
i:
  234105: c26aea5
  234103: b007639
v: v3
  • Loading branch information
Linus Torvalds committed Mar 14, 2011
1 parent c719d41 commit 7047a8d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b77b708868c23737a4d25a474736cc924deb44f1
refs/heads/master: 786c58b7275ae885a3cee9d5bcf8721d962861ac
12 changes: 10 additions & 2 deletions trunk/fs/partitions/osf.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
#include "check.h"
#include "osf.h"

#define MAX_OSF_PARTITIONS 8

int osf_partition(struct parsed_partitions *state)
{
int i;
int slot = 1;
unsigned int npartitions;
Sector sect;
unsigned char *data;
struct disklabel {
Expand Down Expand Up @@ -45,7 +48,7 @@ int osf_partition(struct parsed_partitions *state)
u8 p_fstype;
u8 p_frag;
__le16 p_cpg;
} d_partitions[8];
} d_partitions[MAX_OSF_PARTITIONS];
} * label;
struct d_partition * partition;

Expand All @@ -63,7 +66,12 @@ int osf_partition(struct parsed_partitions *state)
put_dev_sector(sect);
return 0;
}
for (i = 0 ; i < le16_to_cpu(label->d_npartitions); i++, partition++) {
npartitions = le16_to_cpu(label->d_npartitions);
if (npartitions > MAX_OSF_PARTITIONS) {
put_dev_sector(sect);
return 0;
}
for (i = 0 ; i < npartitions; i++, partition++) {
if (slot == state->limit)
break;
if (le32_to_cpu(partition->p_size))
Expand Down
6 changes: 5 additions & 1 deletion trunk/mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,10 @@ static void collapse_huge_page(struct mm_struct *mm,
#ifndef CONFIG_NUMA
VM_BUG_ON(!*hpage);
new_page = *hpage;
if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
up_read(&mm->mmap_sem);
return;
}
#else
VM_BUG_ON(*hpage);
/*
Expand All @@ -1781,12 +1785,12 @@ static void collapse_huge_page(struct mm_struct *mm,
*hpage = ERR_PTR(-ENOMEM);
return;
}
#endif
if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
up_read(&mm->mmap_sem);
put_page(new_page);
return;
}
#endif

/* after allocating the hugepage upgrade to mmap_sem write mode */
up_read(&mm->mmap_sem);
Expand Down

0 comments on commit 7047a8d

Please sign in to comment.