Commit 8207649c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (fixes from Andrew Morton)

Merge fixes from Andrew Morton:
 "9 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: softdirty: keep bit when zapping file pte
  fs/cachefiles: add missing \n to kerror conversions
  genalloc: fix device node resource counter
  drivers/rtc/rtc-efi.c: add missing module alias
  mm, slab: initialize object alignment on cache creation
  mm: softdirty: addresses before VMAs in PTE holes aren't softdirty
  ocfs2/dlm: do not get resource spinlock if lockres is new
  nilfs2: fix data loss with mmap()
  ocfs2: free vol_label in ocfs2_delete_osb()
parents f4cb707e dbab31aa
...@@ -232,6 +232,7 @@ static struct platform_driver efi_rtc_driver = { ...@@ -232,6 +232,7 @@ static struct platform_driver efi_rtc_driver = {
module_platform_driver_probe(efi_rtc_driver, efi_rtc_probe); module_platform_driver_probe(efi_rtc_driver, efi_rtc_probe);
MODULE_ALIAS("platform:rtc-efi");
MODULE_AUTHOR("dann frazier <dannf@hp.com>"); MODULE_AUTHOR("dann frazier <dannf@hp.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("EFI RTC driver"); MODULE_DESCRIPTION("EFI RTC driver");
...@@ -50,18 +50,18 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args) ...@@ -50,18 +50,18 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
cache->brun_percent < 100); cache->brun_percent < 100);
if (*args) { if (*args) {
pr_err("'bind' command doesn't take an argument"); pr_err("'bind' command doesn't take an argument\n");
return -EINVAL; return -EINVAL;
} }
if (!cache->rootdirname) { if (!cache->rootdirname) {
pr_err("No cache directory specified"); pr_err("No cache directory specified\n");
return -EINVAL; return -EINVAL;
} }
/* don't permit already bound caches to be re-bound */ /* don't permit already bound caches to be re-bound */
if (test_bit(CACHEFILES_READY, &cache->flags)) { if (test_bit(CACHEFILES_READY, &cache->flags)) {
pr_err("Cache already bound"); pr_err("Cache already bound\n");
return -EBUSY; return -EBUSY;
} }
...@@ -248,7 +248,7 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache) ...@@ -248,7 +248,7 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
kmem_cache_free(cachefiles_object_jar, fsdef); kmem_cache_free(cachefiles_object_jar, fsdef);
error_root_object: error_root_object:
cachefiles_end_secure(cache, saved_cred); cachefiles_end_secure(cache, saved_cred);
pr_err("Failed to register: %d", ret); pr_err("Failed to register: %d\n", ret);
return ret; return ret;
} }
......
...@@ -315,7 +315,7 @@ static unsigned int cachefiles_daemon_poll(struct file *file, ...@@ -315,7 +315,7 @@ static unsigned int cachefiles_daemon_poll(struct file *file,
static int cachefiles_daemon_range_error(struct cachefiles_cache *cache, static int cachefiles_daemon_range_error(struct cachefiles_cache *cache,
char *args) char *args)
{ {
pr_err("Free space limits must be in range 0%%<=stop<cull<run<100%%"); pr_err("Free space limits must be in range 0%%<=stop<cull<run<100%%\n");
return -EINVAL; return -EINVAL;
} }
...@@ -475,12 +475,12 @@ static int cachefiles_daemon_dir(struct cachefiles_cache *cache, char *args) ...@@ -475,12 +475,12 @@ static int cachefiles_daemon_dir(struct cachefiles_cache *cache, char *args)
_enter(",%s", args); _enter(",%s", args);
if (!*args) { if (!*args) {
pr_err("Empty directory specified"); pr_err("Empty directory specified\n");
return -EINVAL; return -EINVAL;
} }
if (cache->rootdirname) { if (cache->rootdirname) {
pr_err("Second cache directory specified"); pr_err("Second cache directory specified\n");
return -EEXIST; return -EEXIST;
} }
...@@ -503,12 +503,12 @@ static int cachefiles_daemon_secctx(struct cachefiles_cache *cache, char *args) ...@@ -503,12 +503,12 @@ static int cachefiles_daemon_secctx(struct cachefiles_cache *cache, char *args)
_enter(",%s", args); _enter(",%s", args);
if (!*args) { if (!*args) {
pr_err("Empty security context specified"); pr_err("Empty security context specified\n");
return -EINVAL; return -EINVAL;
} }
if (cache->secctx) { if (cache->secctx) {
pr_err("Second security context specified"); pr_err("Second security context specified\n");
return -EINVAL; return -EINVAL;
} }
...@@ -531,7 +531,7 @@ static int cachefiles_daemon_tag(struct cachefiles_cache *cache, char *args) ...@@ -531,7 +531,7 @@ static int cachefiles_daemon_tag(struct cachefiles_cache *cache, char *args)
_enter(",%s", args); _enter(",%s", args);
if (!*args) { if (!*args) {
pr_err("Empty tag specified"); pr_err("Empty tag specified\n");
return -EINVAL; return -EINVAL;
} }
...@@ -562,12 +562,12 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args) ...@@ -562,12 +562,12 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
goto inval; goto inval;
if (!test_bit(CACHEFILES_READY, &cache->flags)) { if (!test_bit(CACHEFILES_READY, &cache->flags)) {
pr_err("cull applied to unready cache"); pr_err("cull applied to unready cache\n");
return -EIO; return -EIO;
} }
if (test_bit(CACHEFILES_DEAD, &cache->flags)) { if (test_bit(CACHEFILES_DEAD, &cache->flags)) {
pr_err("cull applied to dead cache"); pr_err("cull applied to dead cache\n");
return -EIO; return -EIO;
} }
...@@ -587,11 +587,11 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args) ...@@ -587,11 +587,11 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
notdir: notdir:
path_put(&path); path_put(&path);
pr_err("cull command requires dirfd to be a directory"); pr_err("cull command requires dirfd to be a directory\n");
return -ENOTDIR; return -ENOTDIR;
inval: inval:
pr_err("cull command requires dirfd and filename"); pr_err("cull command requires dirfd and filename\n");
return -EINVAL; return -EINVAL;
} }
...@@ -614,7 +614,7 @@ static int cachefiles_daemon_debug(struct cachefiles_cache *cache, char *args) ...@@ -614,7 +614,7 @@ static int cachefiles_daemon_debug(struct cachefiles_cache *cache, char *args)
return 0; return 0;
inval: inval:
pr_err("debug command requires mask"); pr_err("debug command requires mask\n");
return -EINVAL; return -EINVAL;
} }
...@@ -634,12 +634,12 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args) ...@@ -634,12 +634,12 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
goto inval; goto inval;
if (!test_bit(CACHEFILES_READY, &cache->flags)) { if (!test_bit(CACHEFILES_READY, &cache->flags)) {
pr_err("inuse applied to unready cache"); pr_err("inuse applied to unready cache\n");
return -EIO; return -EIO;
} }
if (test_bit(CACHEFILES_DEAD, &cache->flags)) { if (test_bit(CACHEFILES_DEAD, &cache->flags)) {
pr_err("inuse applied to dead cache"); pr_err("inuse applied to dead cache\n");
return -EIO; return -EIO;
} }
...@@ -659,11 +659,11 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args) ...@@ -659,11 +659,11 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
notdir: notdir:
path_put(&path); path_put(&path);
pr_err("inuse command requires dirfd to be a directory"); pr_err("inuse command requires dirfd to be a directory\n");
return -ENOTDIR; return -ENOTDIR;
inval: inval:
pr_err("inuse command requires dirfd and filename"); pr_err("inuse command requires dirfd and filename\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -255,7 +255,7 @@ extern int cachefiles_remove_object_xattr(struct cachefiles_cache *cache, ...@@ -255,7 +255,7 @@ extern int cachefiles_remove_object_xattr(struct cachefiles_cache *cache,
#define cachefiles_io_error(___cache, FMT, ...) \ #define cachefiles_io_error(___cache, FMT, ...) \
do { \ do { \
pr_err("I/O Error: " FMT, ##__VA_ARGS__); \ pr_err("I/O Error: " FMT"\n", ##__VA_ARGS__); \
fscache_io_error(&(___cache)->cache); \ fscache_io_error(&(___cache)->cache); \
set_bit(CACHEFILES_DEAD, &(___cache)->flags); \ set_bit(CACHEFILES_DEAD, &(___cache)->flags); \
} while (0) } while (0)
......
...@@ -84,7 +84,7 @@ static int __init cachefiles_init(void) ...@@ -84,7 +84,7 @@ static int __init cachefiles_init(void)
error_object_jar: error_object_jar:
misc_deregister(&cachefiles_dev); misc_deregister(&cachefiles_dev);
error_dev: error_dev:
pr_err("failed to register: %d", ret); pr_err("failed to register: %d\n", ret);
return ret; return ret;
} }
......
...@@ -543,7 +543,7 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent, ...@@ -543,7 +543,7 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent,
next, next->d_inode, next->d_inode->i_ino); next, next->d_inode, next->d_inode->i_ino);
} else if (!S_ISDIR(next->d_inode->i_mode)) { } else if (!S_ISDIR(next->d_inode->i_mode)) {
pr_err("inode %lu is not a directory", pr_err("inode %lu is not a directory\n",
next->d_inode->i_ino); next->d_inode->i_ino);
ret = -ENOBUFS; ret = -ENOBUFS;
goto error; goto error;
...@@ -574,7 +574,7 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent, ...@@ -574,7 +574,7 @@ int cachefiles_walk_to_object(struct cachefiles_object *parent,
} else if (!S_ISDIR(next->d_inode->i_mode) && } else if (!S_ISDIR(next->d_inode->i_mode) &&
!S_ISREG(next->d_inode->i_mode) !S_ISREG(next->d_inode->i_mode)
) { ) {
pr_err("inode %lu is not a file or directory", pr_err("inode %lu is not a file or directory\n",
next->d_inode->i_ino); next->d_inode->i_ino);
ret = -ENOBUFS; ret = -ENOBUFS;
goto error; goto error;
...@@ -768,7 +768,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache, ...@@ -768,7 +768,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
ASSERT(subdir->d_inode); ASSERT(subdir->d_inode);
if (!S_ISDIR(subdir->d_inode->i_mode)) { if (!S_ISDIR(subdir->d_inode->i_mode)) {
pr_err("%s is not a directory", dirname); pr_err("%s is not a directory\n", dirname);
ret = -EIO; ret = -EIO;
goto check_error; goto check_error;
} }
...@@ -796,13 +796,13 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache, ...@@ -796,13 +796,13 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
mkdir_error: mkdir_error:
mutex_unlock(&dir->d_inode->i_mutex); mutex_unlock(&dir->d_inode->i_mutex);
dput(subdir); dput(subdir);
pr_err("mkdir %s failed with error %d", dirname, ret); pr_err("mkdir %s failed with error %d\n", dirname, ret);
return ERR_PTR(ret); return ERR_PTR(ret);
lookup_error: lookup_error:
mutex_unlock(&dir->d_inode->i_mutex); mutex_unlock(&dir->d_inode->i_mutex);
ret = PTR_ERR(subdir); ret = PTR_ERR(subdir);
pr_err("Lookup %s failed with error %d", dirname, ret); pr_err("Lookup %s failed with error %d\n", dirname, ret);
return ERR_PTR(ret); return ERR_PTR(ret);
nomem_d_alloc: nomem_d_alloc:
...@@ -892,7 +892,7 @@ static struct dentry *cachefiles_check_active(struct cachefiles_cache *cache, ...@@ -892,7 +892,7 @@ static struct dentry *cachefiles_check_active(struct cachefiles_cache *cache,
if (ret == -EIO) { if (ret == -EIO) {
cachefiles_io_error(cache, "Lookup failed"); cachefiles_io_error(cache, "Lookup failed");
} else if (ret != -ENOMEM) { } else if (ret != -ENOMEM) {
pr_err("Internal error: %d", ret); pr_err("Internal error: %d\n", ret);
ret = -EIO; ret = -EIO;
} }
...@@ -951,7 +951,7 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir, ...@@ -951,7 +951,7 @@ int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir,
} }
if (ret != -ENOMEM) { if (ret != -ENOMEM) {
pr_err("Internal error: %d", ret); pr_err("Internal error: %d\n", ret);
ret = -EIO; ret = -EIO;
} }
......
...@@ -51,7 +51,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object) ...@@ -51,7 +51,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
} }
if (ret != -EEXIST) { if (ret != -EEXIST) {
pr_err("Can't set xattr on %*.*s [%lu] (err %d)", pr_err("Can't set xattr on %*.*s [%lu] (err %d)\n",
dentry->d_name.len, dentry->d_name.len, dentry->d_name.len, dentry->d_name.len,
dentry->d_name.name, dentry->d_inode->i_ino, dentry->d_name.name, dentry->d_inode->i_ino,
-ret); -ret);
...@@ -64,7 +64,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object) ...@@ -64,7 +64,7 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
if (ret == -ERANGE) if (ret == -ERANGE)
goto bad_type_length; goto bad_type_length;
pr_err("Can't read xattr on %*.*s [%lu] (err %d)", pr_err("Can't read xattr on %*.*s [%lu] (err %d)\n",
dentry->d_name.len, dentry->d_name.len, dentry->d_name.len, dentry->d_name.len,
dentry->d_name.name, dentry->d_inode->i_ino, dentry->d_name.name, dentry->d_inode->i_ino,
-ret); -ret);
...@@ -85,14 +85,14 @@ int cachefiles_check_object_type(struct cachefiles_object *object) ...@@ -85,14 +85,14 @@ int cachefiles_check_object_type(struct cachefiles_object *object)
return ret; return ret;
bad_type_length: bad_type_length:
pr_err("Cache object %lu type xattr length incorrect", pr_err("Cache object %lu type xattr length incorrect\n",
dentry->d_inode->i_ino); dentry->d_inode->i_ino);
ret = -EIO; ret = -EIO;
goto error; goto error;
bad_type: bad_type:
xtype[2] = 0; xtype[2] = 0;
pr_err("Cache object %*.*s [%lu] type %s not %s", pr_err("Cache object %*.*s [%lu] type %s not %s\n",
dentry->d_name.len, dentry->d_name.len, dentry->d_name.len, dentry->d_name.len,
dentry->d_name.name, dentry->d_inode->i_ino, dentry->d_name.name, dentry->d_inode->i_ino,
xtype, type); xtype, type);
...@@ -293,7 +293,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object, ...@@ -293,7 +293,7 @@ int cachefiles_check_object_xattr(struct cachefiles_object *object,
return ret; return ret;
bad_type_length: bad_type_length:
pr_err("Cache object %lu xattr length incorrect", pr_err("Cache object %lu xattr length incorrect\n",
dentry->d_inode->i_ino); dentry->d_inode->i_ino);
ret = -EIO; ret = -EIO;
goto error; goto error;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/mpage.h> #include <linux/mpage.h>
#include <linux/pagemap.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/aio.h> #include <linux/aio.h>
#include "nilfs.h" #include "nilfs.h"
...@@ -219,10 +220,10 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -219,10 +220,10 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
static int nilfs_set_page_dirty(struct page *page) static int nilfs_set_page_dirty(struct page *page)
{ {
struct inode *inode = page->mapping->host;
int ret = __set_page_dirty_nobuffers(page); int ret = __set_page_dirty_nobuffers(page);
if (page_has_buffers(page)) { if (page_has_buffers(page)) {
struct inode *inode = page->mapping->host;
unsigned nr_dirty = 0; unsigned nr_dirty = 0;
struct buffer_head *bh, *head; struct buffer_head *bh, *head;
...@@ -245,6 +246,10 @@ static int nilfs_set_page_dirty(struct page *page) ...@@ -245,6 +246,10 @@ static int nilfs_set_page_dirty(struct page *page)
if (nr_dirty) if (nr_dirty)
nilfs_set_file_dirty(inode, nr_dirty); nilfs_set_file_dirty(inode, nr_dirty);
} else if (ret) {
unsigned nr_dirty = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits);
nilfs_set_file_dirty(inode, nr_dirty);
} }
return ret; return ret;
} }
......
...@@ -655,12 +655,9 @@ void dlm_lockres_clear_refmap_bit(struct dlm_ctxt *dlm, ...@@ -655,12 +655,9 @@ void dlm_lockres_clear_refmap_bit(struct dlm_ctxt *dlm,
clear_bit(bit, res->refmap); clear_bit(bit, res->refmap);
} }
static void __dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res) struct dlm_lock_resource *res)
{ {
assert_spin_locked(&res->spinlock);
res->inflight_locks++; res->inflight_locks++;
mlog(0, "%s: res %.*s, inflight++: now %u, %ps()\n", dlm->name, mlog(0, "%s: res %.*s, inflight++: now %u, %ps()\n", dlm->name,
...@@ -668,6 +665,13 @@ void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm, ...@@ -668,6 +665,13 @@ void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
__builtin_return_address(0)); __builtin_return_address(0));
} }
void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res)
{
assert_spin_locked(&res->spinlock);
__dlm_lockres_grab_inflight_ref(dlm, res);
}
void dlm_lockres_drop_inflight_ref(struct dlm_ctxt *dlm, void dlm_lockres_drop_inflight_ref(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res) struct dlm_lock_resource *res)
{ {
...@@ -894,10 +898,8 @@ struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm, ...@@ -894,10 +898,8 @@ struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm,
/* finally add the lockres to its hash bucket */ /* finally add the lockres to its hash bucket */
__dlm_insert_lockres(dlm, res); __dlm_insert_lockres(dlm, res);
/* Grab inflight ref to pin the resource */ /* since this lockres is new it doesn't not require the spinlock */
spin_lock(&res->spinlock); __dlm_lockres_grab_inflight_ref(dlm, res);
dlm_lockres_grab_inflight_ref(dlm, res);
spin_unlock(&res->spinlock);
/* get an extra ref on the mle in case this is a BLOCK /* get an extra ref on the mle in case this is a BLOCK
* if so, the creator of the BLOCK may try to put the last * if so, the creator of the BLOCK may try to put the last
......
...@@ -2532,6 +2532,7 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb) ...@@ -2532,6 +2532,7 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
kfree(osb->journal); kfree(osb->journal);
kfree(osb->local_alloc_copy); kfree(osb->local_alloc_copy);
kfree(osb->uuid_str); kfree(osb->uuid_str);
kfree(osb->vol_label);
ocfs2_put_dlm_debug(osb->osb_dlm_debug); ocfs2_put_dlm_debug(osb->osb_dlm_debug);
memset(osb, 0, sizeof(struct ocfs2_super)); memset(osb, 0, sizeof(struct ocfs2_super));
} }
......
...@@ -931,23 +931,32 @@ static int pagemap_pte_hole(unsigned long start, unsigned long end, ...@@ -931,23 +931,32 @@ static int pagemap_pte_hole(unsigned long start, unsigned long end,
while (addr < end) { while (addr < end) {
struct vm_area_struct *vma = find_vma(walk->mm, addr); struct vm_area_struct *vma = find_vma(walk->mm, addr);
pagemap_entry_t pme = make_pme(PM_NOT_PRESENT(pm->v2)); pagemap_entry_t pme = make_pme(PM_NOT_PRESENT(pm->v2));
unsigned long vm_end; /* End of address space hole, which we mark as non-present. */
unsigned long hole_end;
if (!vma) { if (vma)
vm_end = end; hole_end = min(end, vma->vm_start);
} else { else
vm_end = min(end, vma->vm_end); hole_end = end;
if (vma->vm_flags & VM_SOFTDIRTY)
pme.pme |= PM_STATUS2(pm->v2, __PM_SOFT_DIRTY); for (; addr < hole_end; addr += PAGE_SIZE) {
err = add_to_pagemap(addr, &pme, pm);
if (err)
goto out;
} }
for (; addr < vm_end; addr += PAGE_SIZE) { if (!vma)
break;
/* Addresses in the VMA. */
if (vma->vm_flags & VM_SOFTDIRTY)
pme.pme |= PM_STATUS2(pm->v2, __PM_SOFT_DIRTY);
for (; addr < min(end, vma->vm_end); addr += PAGE_SIZE) {
err = add_to_pagemap(addr, &pme, pm); err = add_to_pagemap(addr, &pme, pm);
if (err) if (err)
goto out; goto out;
} }
} }
out: out:
return err; return err;
} }
......
...@@ -588,6 +588,7 @@ struct gen_pool *of_get_named_gen_pool(struct device_node *np, ...@@ -588,6 +588,7 @@ struct gen_pool *of_get_named_gen_pool(struct device_node *np,
if (!np_pool) if (!np_pool)
return NULL; return NULL;
pdev = of_find_device_by_node(np_pool); pdev = of_find_device_by_node(np_pool);
of_node_put(np_pool);
if (!pdev) if (!pdev)
return NULL; return NULL;
return dev_get_gen_pool(&pdev->dev); return dev_get_gen_pool(&pdev->dev);
......
...@@ -1127,7 +1127,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, ...@@ -1127,7 +1127,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
addr) != page->index) { addr) != page->index) {
pte_t ptfile = pgoff_to_pte(page->index); pte_t ptfile = pgoff_to_pte(page->index);
if (pte_soft_dirty(ptent)) if (pte_soft_dirty(ptent))
pte_file_mksoft_dirty(ptfile); ptfile = pte_file_mksoft_dirty(ptfile);
set_pte_at(mm, addr, pte, ptfile); set_pte_at(mm, addr, pte, ptfile);
} }
if (PageAnon(page)) if (PageAnon(page))
......
...@@ -2124,7 +2124,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp) ...@@ -2124,7 +2124,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
int int
__kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
{ {
size_t left_over, freelist_size, ralign; size_t left_over, freelist_size;
size_t ralign = BYTES_PER_WORD;
gfp_t gfp; gfp_t gfp;
int err; int err;
size_t size = cachep->size; size_t size = cachep->size;
...@@ -2157,14 +2158,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) ...@@ -2157,14 +2158,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
size &= ~(BYTES_PER_WORD - 1); size &= ~(BYTES_PER_WORD - 1);
} }
/*
* Redzoning and user store require word alignment or possibly larger.
* Note this will be overridden by architecture or caller mandated
* alignment if either is greater than BYTES_PER_WORD.
*/
if (flags & SLAB_STORE_USER)
ralign = BYTES_PER_WORD;
if (flags & SLAB_RED_ZONE) { if (flags & SLAB_RED_ZONE) {
ralign = REDZONE_ALIGN; ralign = REDZONE_ALIGN;
/* If redzoning, ensure that the second redzone is suitably /* If redzoning, ensure that the second redzone is suitably
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment