From 828c09509b9695271bcbdc53e9fc9a6a737148d2 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Thu, 1 Oct 2009 15:43:56 -0700 Subject: const: constify remaining file_operations [akpm@linux-foundation.org: fix KVM] Signed-off-by: Alexey Dobriyan Acked-by: Mike Frysinger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- security/integrity/ima/ima_fs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'security/integrity') diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c index 8e9777b7640..0c72c9c3895 100644 --- a/security/integrity/ima/ima_fs.c +++ b/security/integrity/ima/ima_fs.c @@ -43,7 +43,7 @@ static ssize_t ima_show_htable_violations(struct file *filp, return ima_show_htable_value(buf, count, ppos, &ima_htable.violations); } -static struct file_operations ima_htable_violations_ops = { +static const struct file_operations ima_htable_violations_ops = { .read = ima_show_htable_violations }; @@ -55,7 +55,7 @@ static ssize_t ima_show_measurements_count(struct file *filp, } -static struct file_operations ima_measurements_count_ops = { +static const struct file_operations ima_measurements_count_ops = { .read = ima_show_measurements_count }; @@ -158,7 +158,7 @@ static int ima_measurements_open(struct inode *inode, struct file *file) return seq_open(file, &ima_measurments_seqops); } -static struct file_operations ima_measurements_ops = { +static const struct file_operations ima_measurements_ops = { .open = ima_measurements_open, .read = seq_read, .llseek = seq_lseek, @@ -233,7 +233,7 @@ static int ima_ascii_measurements_open(struct inode *inode, struct file *file) return seq_open(file, &ima_ascii_measurements_seqops); } -static struct file_operations ima_ascii_measurements_ops = { +static const struct file_operations ima_ascii_measurements_ops = { .open = ima_ascii_measurements_open, .read = seq_read, .llseek = seq_lseek, @@ -313,7 +313,7 @@ static int ima_release_policy(struct inode *inode, struct file *file) return 0; } -static struct file_operations ima_measure_policy_ops = { +static const struct file_operations ima_measure_policy_ops = { .open = ima_open_policy, .write = ima_write_policy, .release = ima_release_policy -- cgit v1.2.3 From c09c59e6a070d6af05f238f255aea268185273ef Mon Sep 17 00:00:00 2001 From: Mimi Zohar Date: Wed, 18 Nov 2009 16:16:06 -0500 Subject: ima: replace GFP_KERNEL with GFP_NOFS While running fsstress tests on the NFSv4 mounted ext3 and ext4 filesystem, the following call trace was generated on the nfs server machine. Replace GFP_KERNEL with GFP_NOFS in ima_iint_insert() to avoid a potential deadlock. ================================= [ INFO: inconsistent lock state ] 2.6.31-31.el6.x86_64 #1 --------------------------------- inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-W} usage. kswapd2/75 [HC0[0]:SC0[0]:HE1:SE1] takes: (jbd2_handle){+.+.?.}, at: [] jbd2_journal_start+0xfe/0x13f {RECLAIM_FS-ON-W} state was registered at: [] mark_held_locks+0x65/0x99 [] lockdep_trace_alloc+0xbd/0xf5 [] kmem_cache_alloc+0x40/0x185 [] ima_iint_insert+0x3d/0xf1 [] ima_inode_alloc+0x25/0x44 [] inode_init_always+0xec/0x271 [] alloc_inode+0x51/0xa1 [] new_inode+0x2e/0x94 [] ext4_new_inode+0xb8/0xdc9 [] ext4_create+0xcf/0x175 [] vfs_create+0x82/0xb8 [] do_filp_open+0x32c/0x9ee [] do_sys_open+0x6c/0x12c [] sys_open+0x2e/0x44 [] system_call_fastpath+0x16/0x1b [] 0xffffffffffffffff irq event stamp: 90371 hardirqs last enabled at (90371): [] kmem_cache_alloc+0xf0/0x185 hardirqs last disabled at (90370): [] kmem_cache_alloc+0x89/0x185 softirqs last enabled at (89492): [] __do_softirq+0x1bf/0x1eb softirqs last disabled at (89477): [] call_softirq+0x1c/0x30 other info that might help us debug this: 2 locks held by kswapd2/75: #0: (shrinker_rwsem){++++..}, at: [] shrink_slab+0x44/0x177 #1: (&type->s_umount_key#25){++++..}, at: [] Reported-by: Muni P. Beerakam Reported-by: Amit K. Arora Cc: stable@kernel.org Signed-off-by: Mimi Zohar Signed-off-by: James Morris --- security/integrity/ima/ima_iint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'security/integrity') diff --git a/security/integrity/ima/ima_iint.c b/security/integrity/ima/ima_iint.c index b8dd693f879..a4e2b1dac94 100644 --- a/security/integrity/ima/ima_iint.c +++ b/security/integrity/ima/ima_iint.c @@ -58,11 +58,11 @@ struct ima_iint_cache *ima_iint_insert(struct inode *inode) if (!ima_initialized) return iint; - iint = kmem_cache_alloc(iint_cache, GFP_KERNEL); + iint = kmem_cache_alloc(iint_cache, GFP_NOFS); if (!iint) return iint; - rc = radix_tree_preload(GFP_KERNEL); + rc = radix_tree_preload(GFP_NOFS); if (rc < 0) goto out; -- cgit v1.2.3