05 Jan, 2010

4 commits


04 Jan, 2010

1 commit


03 Jan, 2010

2 commits

  • …t/frederic/random-tracing

    * 'reiserfs/kill-bkl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
    reiserfs: Safely acquire i_mutex from xattr_rmdir
    reiserfs: Safely acquire i_mutex from reiserfs_for_each_xattr
    reiserfs: Fix journal mutex <-> inode mutex lock inversion
    reiserfs: Fix unwanted recursive reiserfs lock in reiserfs_unlink()
    reiserfs: Relax lock before open xattr dir in reiserfs_xattr_set_handle()
    reiserfs: Relax reiserfs lock while freeing the journal
    reiserfs: Fix reiserfs lock <-> i_mutex dependency inversion on xattr
    reiserfs: Warn on lock relax if taken recursively
    reiserfs: Fix reiserfs lock <-> i_xattr_sem dependency inversion
    reiserfs: Fix remaining in-reclaim-fs <-> reclaim-fs-on locking inversion
    reiserfs: Fix reiserfs lock <-> inode mutex dependency inversion
    reiserfs: Fix reiserfs lock and journal lock inversion dependency
    reiserfs: Fix possible recursive lock

    Linus Torvalds
     
  • Fix the following htmldocs warning:

    Warning(fs/fs-writeback.c:255): No description found for parameter 'sb'

    Signed-off-by: Jaswinder Singh Rajput
    Signed-off-by: Randy Dunlap
    Acked-by: Wu Fengguang
    Cc: Peter Zijlstra
    Cc: Jan Kara
    Cc: Jens Axboe
    Signed-off-by: Linus Torvalds

    Jaswinder Singh Rajput
     

02 Jan, 2010

9 commits

  • Relax the reiserfs lock before taking the inode mutex from
    xattr_rmdir() to avoid the usual reiserfs lock inode mutex
    bad dependency.

    Signed-off-by: Frederic Weisbecker
    Tested-by: Christian Kujau
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • Relax the reiserfs lock before taking the inode mutex from
    reiserfs_for_each_xattr() to avoid the usual bad dependencies:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.32-atom #179
    -------------------------------------------------------
    rm/3242 is trying to acquire lock:
    (&sb->s_type->i_mutex_key#4/3){+.+.+.}, at: [] reiserfs_for_each_xattr+0x23f/0x290

    but task is already holding lock:
    (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock+0x29/0x40

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&REISERFS_SB(s)->lock){+.+.+.}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_lookup+0x62/0x140
    [] __lookup_hash+0xef/0x110
    [] lookup_one_len+0x8d/0xc0
    [] open_xa_dir+0xea/0x1b0
    [] reiserfs_for_each_xattr+0x70/0x290
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] reiserfs_delete_inode+0x9f/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] sys_unlinkat+0x23/0x40
    [] sysenter_do_call+0x12/0x32

    -> #0 (&sb->s_type->i_mutex_key#4/3){+.+.+.}:
    [] __lock_acquire+0x18f6/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] reiserfs_for_each_xattr+0x23f/0x290
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] reiserfs_delete_inode+0x9f/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] sys_unlinkat+0x23/0x40
    [] sysenter_do_call+0x12/0x32

    other info that might help us debug this:

    1 lock held by rm/3242:
    #0: (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock+0x29/0x40

    stack backtrace:
    Pid: 3242, comm: rm Not tainted 2.6.32-atom #179
    Call Trace:
    [] ? printk+0x18/0x1a
    [] print_circular_bug+0xca/0xd0
    [] __lock_acquire+0x18f6/0x19e0
    [] ? mark_held_locks+0x62/0x80
    [] ? trace_hardirqs_on+0xb/0x10
    [] ? mutex_unlock+0x8/0x10
    [] lock_acquire+0x68/0x90
    [] ? reiserfs_for_each_xattr+0x23f/0x290
    [] ? reiserfs_for_each_xattr+0x23f/0x290
    [] mutex_lock_nested+0x5b/0x340
    [] ? reiserfs_for_each_xattr+0x23f/0x290
    [] reiserfs_for_each_xattr+0x23f/0x290
    [] ? delete_one_xattr+0x0/0x100
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_delete_inode+0x9f/0x150
    [] ? _atomic_dec_and_lock+0x4f/0x70
    [] ? reiserfs_delete_inode+0x0/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] ? mutex_unlock+0x8/0x10
    [] ? vfs_readdir+0x7d/0xb0
    [] ? filldir64+0x0/0xf0
    [] ? sysenter_exit+0xf/0x16
    [] ? trace_hardirqs_on_caller+0x124/0x170
    [] sys_unlinkat+0x23/0x40
    [] sysenter_do_call+0x12/0x32

    Signed-off-by: Frederic Weisbecker
    Tested-by: Christian Kujau
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • We need to relax the reiserfs lock before locking the inode mutex
    from xattr_unlink(), otherwise we'll face the usual bad dependencies:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.32-atom #178
    -------------------------------------------------------
    rm/3202 is trying to acquire lock:
    (&journal->j_mutex){+.+...}, at: [] do_journal_begin_r+0x94/0x360

    but task is already holding lock:
    (&sb->s_type->i_mutex_key#4/2){+.+...}, at: [] xattr_unlink+0x57/0xb0

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #2 (&sb->s_type->i_mutex_key#4/2){+.+...}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] xattr_unlink+0x57/0xb0
    [] delete_one_xattr+0x29/0x100
    [] reiserfs_for_each_xattr+0x10b/0x290
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] reiserfs_delete_inode+0x9f/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] sys_unlinkat+0x23/0x40
    [] sysenter_do_call+0x12/0x32

    -> #1 (&REISERFS_SB(s)->lock){+.+.+.}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] reiserfs_write_lock+0x29/0x40
    [] do_journal_begin_r+0x9c/0x360
    [] journal_begin+0x80/0x130
    [] reiserfs_remount+0x223/0x4e0
    [] do_remount_sb+0xa6/0x140
    [] do_mount+0x560/0x750
    [] sys_mount+0x84/0xb0
    [] sysenter_do_call+0x12/0x32

    -> #0 (&journal->j_mutex){+.+...}:
    [] __lock_acquire+0x18f6/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] do_journal_begin_r+0x94/0x360
    [] journal_begin+0x80/0x130
    [] reiserfs_unlink+0x83/0x2e0
    [] xattr_unlink+0x64/0xb0
    [] delete_one_xattr+0x29/0x100
    [] reiserfs_for_each_xattr+0x10b/0x290
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] reiserfs_delete_inode+0x9f/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] sys_unlinkat+0x23/0x40
    [] sysenter_do_call+0x12/0x32

    other info that might help us debug this:

    2 locks held by rm/3202:
    #0: (&sb->s_type->i_mutex_key#4/3){+.+.+.}, at: [] reiserfs_for_each_xattr+0x9b/0x290
    #1: (&sb->s_type->i_mutex_key#4/2){+.+...}, at: [] xattr_unlink+0x57/0xb0

    stack backtrace:
    Pid: 3202, comm: rm Not tainted 2.6.32-atom #178
    Call Trace:
    [] ? printk+0x18/0x1a
    [] print_circular_bug+0xca/0xd0
    [] __lock_acquire+0x18f6/0x19e0
    [] ? xattr_unlink+0x57/0xb0
    [] lock_acquire+0x68/0x90
    [] ? do_journal_begin_r+0x94/0x360
    [] ? do_journal_begin_r+0x94/0x360
    [] mutex_lock_nested+0x5b/0x340
    [] ? do_journal_begin_r+0x94/0x360
    [] do_journal_begin_r+0x94/0x360
    [] ? run_timer_softirq+0x1a6/0x220
    [] ? __do_softirq+0x50/0x140
    [] journal_begin+0x80/0x130
    [] ? __do_softirq+0xf2/0x140
    [] ? hrtimer_interrupt+0xdf/0x220
    [] reiserfs_unlink+0x83/0x2e0
    [] ? mark_held_locks+0x62/0x80
    [] ? trace_hardirqs_on_thunk+0xc/0x10
    [] ? restore_all_notrace+0x0/0x18
    [] ? xattr_unlink+0x57/0xb0
    [] xattr_unlink+0x64/0xb0
    [] delete_one_xattr+0x29/0x100
    [] reiserfs_for_each_xattr+0x10b/0x290
    [] ? delete_one_xattr+0x0/0x100
    [] ? mutex_lock_nested+0x299/0x340
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_delete_inode+0x9f/0x150
    [] ? _atomic_dec_and_lock+0x4f/0x70
    [] ? reiserfs_delete_inode+0x0/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] ? mutex_unlock+0x8/0x10
    [] ? vfs_readdir+0x7d/0xb0
    [] ? filldir64+0x0/0xf0
    [] ? sysenter_exit+0xf/0x16
    [] ? trace_hardirqs_on_caller+0x124/0x170
    [] sys_unlinkat+0x23/0x40
    [] sysenter_do_call+0x12/0x32

    Signed-off-by: Frederic Weisbecker
    Tested-by: Christian Kujau
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • reiserfs_unlink() may or may not be called under the reiserfs
    lock.
    But it also takes the reiserfs lock and can then acquire it
    recursively which leads to do_journal_begin_r() that fails to
    relax the reiserfs lock before grabbing the journal mutex,
    creating an unexpected lock inversion.

    We need to ensure reiserfs_unlink() won't get the reiserfs lock
    recursively using reiserfs_write_lock_once().

    This fixes the following warning that precedes a lock inversion
    report (reiserfs lock journal mutex).

    ------------[ cut here ]------------
    WARNING: at fs/reiserfs/lock.c:95 reiserfs_lock_check_recursive+0x3a/0x50()
    Hardware name: MS-7418
    Unwanted recursive reiserfs lock!
    Pid: 3208, comm: dbench Not tainted 2.6.32-atom #177
    Call Trace:
    [] ? reiserfs_lock_check_recursive+0x3a/0x50
    [] ? reiserfs_lock_check_recursive+0x3a/0x50
    [] warn_slowpath_common+0x67/0xc0
    [] ? reiserfs_lock_check_recursive+0x3a/0x50
    [] warn_slowpath_fmt+0x26/0x30
    [] reiserfs_lock_check_recursive+0x3a/0x50
    [] do_journal_begin_r+0x83/0x360
    [] ? __lock_acquire+0x1296/0x19e0
    [] ? xattr_unlink+0x57/0xb0
    [] journal_begin+0x80/0x130
    [] reiserfs_unlink+0x7d/0x2d0
    [] ? xattr_unlink+0x57/0xb0
    [] ? xattr_unlink+0x57/0xb0
    [] ? xattr_unlink+0x57/0xb0
    [] xattr_unlink+0x64/0xb0
    [] delete_one_xattr+0x29/0x100
    [] reiserfs_for_each_xattr+0x10b/0x290
    [] ? delete_one_xattr+0x0/0x100
    [] ? mutex_lock_nested+0x299/0x340
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_delete_inode+0x9f/0x150
    [] ? _atomic_dec_and_lock+0x4f/0x70
    [] ? reiserfs_delete_inode+0x0/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] ? up_read+0x16/0x30
    [] ? do_page_fault+0x187/0x330
    [] ? restore_all_notrace+0x0/0x18
    [] ? do_page_fault+0x0/0x330
    [] ? trace_hardirqs_on_caller+0x124/0x170
    [] sys_unlink+0x10/0x20
    [] sysenter_do_call+0x12/0x32
    ---[ end trace 2e35d71a6cc69d0c ]---

    Signed-off-by: Frederic Weisbecker
    Tested-by: Christian Kujau
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • We call xattr_lookup() from reiserfs_xattr_get(). We then hold
    the reiserfs lock when we grab the i_mutex. But later, we may
    relax the reiserfs lock, creating dependency inversion between
    both locks.

    The lookups and creation jobs ar already protected by the
    inode mutex, so we can safely relax the reiserfs lock, dropping
    the unwanted reiserfs lock -> i_mutex dependency, as shown
    in the following lockdep report:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.32-atom #173
    -------------------------------------------------------
    cp/3204 is trying to acquire lock:
    (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock_once+0x29/0x50

    but task is already holding lock:
    (&sb->s_type->i_mutex_key#4/3){+.+.+.}, at: [] open_xa_dir+0xd8/0x1b0

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&sb->s_type->i_mutex_key#4/3){+.+.+.}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] open_xa_dir+0x43/0x1b0
    [] reiserfs_for_each_xattr+0x62/0x260
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] reiserfs_delete_inode+0x9f/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] sys_unlink+0x10/0x20
    [] sysenter_do_call+0x12/0x32

    -> #0 (&REISERFS_SB(s)->lock){+.+.+.}:
    [] __lock_acquire+0x18f6/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_lookup+0x62/0x140
    [] __lookup_hash+0xef/0x110
    [] lookup_one_len+0x8d/0xc0
    [] open_xa_dir+0xea/0x1b0
    [] xattr_lookup+0x15/0x160
    [] reiserfs_xattr_get+0x56/0x2a0
    [] reiserfs_get_acl+0xa2/0x360
    [] reiserfs_cache_default_acl+0x3a/0x160
    [] reiserfs_mkdir+0x6c/0x2c0
    [] vfs_mkdir+0xd6/0x180
    [] sys_mkdirat+0xc0/0xd0
    [] sys_mkdir+0x20/0x30
    [] sysenter_do_call+0x12/0x32

    other info that might help us debug this:

    2 locks held by cp/3204:
    #0: (&sb->s_type->i_mutex_key#4/1){+.+.+.}, at: [] lookup_create+0x26/0xa0
    #1: (&sb->s_type->i_mutex_key#4/3){+.+.+.}, at: [] open_xa_dir+0xd8/0x1b0

    stack backtrace:
    Pid: 3204, comm: cp Not tainted 2.6.32-atom #173
    Call Trace:
    [] ? printk+0x18/0x1a
    [] print_circular_bug+0xca/0xd0
    [] __lock_acquire+0x18f6/0x19e0
    [] ? check_usage+0x6a/0x460
    [] lock_acquire+0x68/0x90
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] mutex_lock_nested+0x5b/0x340
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_lookup+0x62/0x140
    [] ? debug_check_no_locks_freed+0x8a/0x140
    [] ? trace_hardirqs_on_caller+0x124/0x170
    [] __lookup_hash+0xef/0x110
    [] lookup_one_len+0x8d/0xc0
    [] open_xa_dir+0xea/0x1b0
    [] xattr_lookup+0x15/0x160
    [] reiserfs_xattr_get+0x56/0x2a0
    [] reiserfs_get_acl+0xa2/0x360
    [] ? new_inode+0x27/0xa0
    [] reiserfs_cache_default_acl+0x3a/0x160
    [] ? _spin_unlock+0x27/0x40
    [] reiserfs_mkdir+0x6c/0x2c0
    [] ? __d_lookup+0x108/0x190
    [] ? mark_held_locks+0x62/0x80
    [] ? mutex_lock_nested+0x2bd/0x340
    [] ? generic_permission+0x1a/0xa0
    [] ? security_inode_permission+0x1e/0x20
    [] vfs_mkdir+0xd6/0x180
    [] sys_mkdirat+0xc0/0xd0
    [] ? up_read+0x16/0x30
    [] ? restore_all_notrace+0x0/0x18
    [] sys_mkdir+0x20/0x30
    [] sysenter_do_call+0x12/0x32

    Signed-off-by: Frederic Weisbecker
    Tested-by: Christian Kujau
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • Keeping the reiserfs lock while freeing the journal on
    umount path triggers a lock inversion between bdev->bd_mutex
    and the reiserfs lock.

    We don't need the reiserfs lock at this stage. The filesystem
    is not usable anymore, and there are no more pending commits,
    everything got flushed (even this operation was done in parallel
    and didn't required the reiserfs lock from the current process).

    This fixes the following lockdep report:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.32-atom #172
    -------------------------------------------------------
    umount/3904 is trying to acquire lock:
    (&bdev->bd_mutex){+.+.+.}, at: [] __blkdev_put+0x22/0x160

    but task is already holding lock:
    (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock+0x29/0x40

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #3 (&REISERFS_SB(s)->lock){+.+.+.}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_get_block+0x85/0x1620
    [] do_mpage_readpage+0x1f0/0x6d0
    [] mpage_readpages+0xc0/0x100
    [] reiserfs_readpages+0x19/0x20
    [] __do_page_cache_readahead+0x1bc/0x260
    [] ra_submit+0x28/0x40
    [] filemap_fault+0x40e/0x420
    [] __do_fault+0x3d/0x430
    [] handle_mm_fault+0x12e/0x790
    [] do_page_fault+0x135/0x330
    [] error_code+0x6b/0x70
    [] load_elf_binary+0x82a/0x1a10
    [] search_binary_handler+0x90/0x1d0
    [] do_execve+0x1df/0x250
    [] sys_execve+0x46/0x70
    [] syscall_call+0x7/0xb

    -> #2 (&mm->mmap_sem){++++++}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] might_fault+0x8b/0xb0
    [] copy_to_user+0x32/0x70
    [] filldir64+0xa4/0xf0
    [] sysfs_readdir+0x116/0x210
    [] vfs_readdir+0x8d/0xb0
    [] sys_getdents64+0x69/0xb0
    [] sysenter_do_call+0x12/0x32

    -> #1 (sysfs_mutex){+.+.+.}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] sysfs_addrm_start+0x2c/0xb0
    [] create_dir+0x40/0x90
    [] sysfs_create_dir+0x2b/0x50
    [] kobject_add_internal+0xc2/0x1b0
    [] kobject_add_varg+0x31/0x50
    [] kobject_add+0x2c/0x60
    [] device_add+0x94/0x560
    [] add_partition+0x18a/0x2a0
    [] rescan_partitions+0x33a/0x450
    [] __blkdev_get+0x12f/0x2d0
    [] blkdev_get+0xa/0x10
    [] register_disk+0x108/0x130
    [] add_disk+0xd9/0x130
    [] sd_probe_async+0x105/0x1d0
    [] async_thread+0xcf/0x230
    [] kthread+0x74/0x80
    [] kernel_thread_helper+0x7/0x3c

    -> #0 (&bdev->bd_mutex){+.+.+.}:
    [] __lock_acquire+0x18f6/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] __blkdev_put+0x22/0x160
    [] blkdev_put+0xa/0x10
    [] free_journal_ram+0xd2/0x130
    [] do_journal_release+0x98/0x190
    [] journal_release+0xa/0x10
    [] reiserfs_put_super+0x36/0x130
    [] generic_shutdown_super+0x4f/0xe0
    [] kill_block_super+0x25/0x40
    [] reiserfs_kill_sb+0x7f/0x90
    [] deactivate_super+0x7a/0x90
    [] mntput_no_expire+0x98/0xd0
    [] sys_umount+0x4c/0x310
    [] sys_oldumount+0x19/0x20
    [] sysenter_do_call+0x12/0x32

    other info that might help us debug this:

    2 locks held by umount/3904:
    #0: (&type->s_umount_key#30){+++++.}, at: [] deactivate_super+0x75/0x90
    #1: (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock+0x29/0x40

    stack backtrace:
    Pid: 3904, comm: umount Not tainted 2.6.32-atom #172
    Call Trace:
    [] ? printk+0x18/0x1a
    [] print_circular_bug+0xca/0xd0
    [] __lock_acquire+0x18f6/0x19e0
    [] ? free_pcppages_bulk+0x1f/0x250
    [] lock_acquire+0x68/0x90
    [] ? __blkdev_put+0x22/0x160
    [] ? __blkdev_put+0x22/0x160
    [] mutex_lock_nested+0x5b/0x340
    [] ? __blkdev_put+0x22/0x160
    [] ? mark_held_locks+0x62/0x80
    [] ? kfree+0x92/0xd0
    [] __blkdev_put+0x22/0x160
    [] ? trace_hardirqs_on+0xb/0x10
    [] blkdev_put+0xa/0x10
    [] free_journal_ram+0xd2/0x130
    [] do_journal_release+0x98/0x190
    [] journal_release+0xa/0x10
    [] reiserfs_put_super+0x36/0x130
    [] ? up_write+0x16/0x30
    [] generic_shutdown_super+0x4f/0xe0
    [] kill_block_super+0x25/0x40
    [] ? vfs_quota_off+0x0/0x20
    [] reiserfs_kill_sb+0x7f/0x90
    [] deactivate_super+0x7a/0x90
    [] mntput_no_expire+0x98/0xd0
    [] sys_umount+0x4c/0x310
    [] sys_oldumount+0x19/0x20
    [] sysenter_do_call+0x12/0x32

    Signed-off-by: Frederic Weisbecker
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • While deleting the xattrs of an inode, we hold the reiserfs lock
    and grab the inode->i_mutex of the targeted inode and the root
    private xattr directory.

    Later on, we may relax the reiserfs lock for various reasons, this
    creates inverted dependencies.

    We can remove the reiserfs lock -> i_mutex dependency by relaxing
    the former before calling open_xa_dir(). This is fine because the
    lookup and creation of xattr private directories done in
    open_xa_dir() are covered by the targeted inode mutexes. And deeper
    operations in the tree are still done under the write lock.

    This fixes the following lockdep report:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.32-atom #173
    -------------------------------------------------------
    cp/3204 is trying to acquire lock:
    (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock_once+0x29/0x50

    but task is already holding lock:
    (&sb->s_type->i_mutex_key#4/3){+.+.+.}, at: [] open_xa_dir+0xd8/0x1b0

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&sb->s_type->i_mutex_key#4/3){+.+.+.}:
    [] __lock_acquire+0x11ff/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] open_xa_dir+0x43/0x1b0
    [] reiserfs_for_each_xattr+0x62/0x260
    [] reiserfs_delete_xattrs+0x1a/0x60
    [] reiserfs_delete_inode+0x9f/0x150
    [] generic_delete_inode+0xa2/0x170
    [] generic_drop_inode+0x4f/0x70
    [] iput+0x47/0x50
    [] do_unlinkat+0xd5/0x160
    [] sys_unlink+0x10/0x20
    [] sysenter_do_call+0x12/0x32

    -> #0 (&REISERFS_SB(s)->lock){+.+.+.}:
    [] __lock_acquire+0x18f6/0x19e0
    [] lock_acquire+0x68/0x90
    [] mutex_lock_nested+0x5b/0x340
    [] reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_lookup+0x62/0x140
    [] __lookup_hash+0xef/0x110
    [] lookup_one_len+0x8d/0xc0
    [] open_xa_dir+0xea/0x1b0
    [] xattr_lookup+0x15/0x160
    [] reiserfs_xattr_get+0x56/0x2a0
    [] reiserfs_get_acl+0xa2/0x360
    [] reiserfs_cache_default_acl+0x3a/0x160
    [] reiserfs_mkdir+0x6c/0x2c0
    [] vfs_mkdir+0xd6/0x180
    [] sys_mkdirat+0xc0/0xd0
    [] sys_mkdir+0x20/0x30
    [] sysenter_do_call+0x12/0x32

    other info that might help us debug this:

    2 locks held by cp/3204:
    #0: (&sb->s_type->i_mutex_key#4/1){+.+.+.}, at: [] lookup_create+0x26/0xa0
    #1: (&sb->s_type->i_mutex_key#4/3){+.+.+.}, at: [] open_xa_dir+0xd8/0x1b0

    stack backtrace:
    Pid: 3204, comm: cp Not tainted 2.6.32-atom #173
    Call Trace:
    [] ? printk+0x18/0x1a
    [] print_circular_bug+0xca/0xd0
    [] __lock_acquire+0x18f6/0x19e0
    [] ? check_usage+0x6a/0x460
    [] lock_acquire+0x68/0x90
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] mutex_lock_nested+0x5b/0x340
    [] ? reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_write_lock_once+0x29/0x50
    [] reiserfs_lookup+0x62/0x140
    [] ? debug_check_no_locks_freed+0x8a/0x140
    [] ? trace_hardirqs_on_caller+0x124/0x170
    [] __lookup_hash+0xef/0x110
    [] lookup_one_len+0x8d/0xc0
    [] open_xa_dir+0xea/0x1b0
    [] xattr_lookup+0x15/0x160
    [] reiserfs_xattr_get+0x56/0x2a0
    [] reiserfs_get_acl+0xa2/0x360
    [] ? new_inode+0x27/0xa0
    [] reiserfs_cache_default_acl+0x3a/0x160
    [] ? _spin_unlock+0x27/0x40
    [] reiserfs_mkdir+0x6c/0x2c0
    [] ? __d_lookup+0x108/0x190
    [] ? mark_held_locks+0x62/0x80
    [] ? mutex_lock_nested+0x2bd/0x340
    [] ? generic_permission+0x1a/0xa0
    [] ? security_inode_permission+0x1e/0x20
    [] vfs_mkdir+0xd6/0x180
    [] sys_mkdirat+0xc0/0xd0
    [] ? up_read+0x16/0x30
    [] ? restore_all_notrace+0x0/0x18
    [] sys_mkdir+0x20/0x30
    [] sysenter_do_call+0x12/0x32

    v2: Don't drop reiserfs_mutex_lock_nested_safe() as we'll still
    need it later

    Signed-off-by: Frederic Weisbecker
    Tested-by: Christian Kujau
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • When we relax the reiserfs lock to avoid creating unwanted
    dependencies against others locks while grabbing these,
    we want to ensure it has not been taken recursively, otherwise
    the lock won't be really relaxed. Only its depth will be decreased.
    The unwanted dependency would then actually happen.

    To prevent from that, add a reiserfs_lock_check_recursive() call
    in the places that need it.

    Signed-off-by: Frederic Weisbecker
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     
  • i_xattr_sem depends on the reiserfs lock. But after we grab
    i_xattr_sem, we may relax/relock the reiserfs lock while waiting
    on a freezed filesystem, creating a dependency inversion between
    the two locks.

    In order to avoid the i_xattr_sem -> reiserfs lock dependency, let's
    create a reiserfs_down_read_safe() that acts like
    reiserfs_mutex_lock_safe(): relax the reiserfs lock while grabbing
    another lock to avoid undesired dependencies induced by the
    heivyweight reiserfs lock.

    This fixes the following warning:

    [ 990.005931] =======================================================
    [ 990.012373] [ INFO: possible circular locking dependency detected ]
    [ 990.013233] 2.6.33-rc1 #1
    [ 990.013233] -------------------------------------------------------
    [ 990.013233] dbench/1891 is trying to acquire lock:
    [ 990.013233] (&REISERFS_SB(s)->lock){+.+.+.}, at: [] reiserfs_write_lock+0x35/0x50
    [ 990.013233]
    [ 990.013233] but task is already holding lock:
    [ 990.013233] (&REISERFS_I(inode)->i_xattr_sem){+.+.+.}, at: [] reiserfs_xattr_set_handle+0x8a/0x470
    [ 990.013233]
    [ 990.013233] which lock already depends on the new lock.
    [ 990.013233]
    [ 990.013233]
    [ 990.013233] the existing dependency chain (in reverse order) is:
    [ 990.013233]
    [ 990.013233] -> #1 (&REISERFS_I(inode)->i_xattr_sem){+.+.+.}:
    [ 990.013233] [] __lock_acquire+0xf9c/0x1560
    [ 990.013233] [] lock_acquire+0x8f/0xb0
    [ 990.013233] [] down_write+0x44/0x80
    [ 990.013233] [] reiserfs_xattr_set_handle+0x8a/0x470
    [ 990.013233] [] reiserfs_xattr_set+0xb0/0x150
    [ 990.013233] [] user_set+0x8a/0x90
    [ 990.013233] [] reiserfs_setxattr+0xaa/0xb0
    [ 990.013233] [] __vfs_setxattr_noperm+0x36/0xa0
    [ 990.013233] [] vfs_setxattr+0xbc/0xc0
    [ 990.013233] [] setxattr+0xc0/0x150
    [ 990.013233] [] sys_fsetxattr+0x8d/0xa0
    [ 990.013233] [] system_call_fastpath+0x16/0x1b
    [ 990.013233]
    [ 990.013233] -> #0 (&REISERFS_SB(s)->lock){+.+.+.}:
    [ 990.013233] [] __lock_acquire+0x12d0/0x1560
    [ 990.013233] [] lock_acquire+0x8f/0xb0
    [ 990.013233] [] __mutex_lock_common+0x47/0x3b0
    [ 990.013233] [] mutex_lock_nested+0x3e/0x50
    [ 990.013233] [] reiserfs_write_lock+0x35/0x50
    [ 990.013233] [] reiserfs_prepare_write+0x45/0x180
    [ 990.013233] [] reiserfs_xattr_set_handle+0x2a6/0x470
    [ 990.013233] [] reiserfs_xattr_set+0xb0/0x150
    [ 990.013233] [] user_set+0x8a/0x90
    [ 990.013233] [] reiserfs_setxattr+0xaa/0xb0
    [ 990.013233] [] __vfs_setxattr_noperm+0x36/0xa0
    [ 990.013233] [] vfs_setxattr+0xbc/0xc0
    [ 990.013233] [] setxattr+0xc0/0x150
    [ 990.013233] [] sys_fsetxattr+0x8d/0xa0
    [ 990.013233] [] system_call_fastpath+0x16/0x1b
    [ 990.013233]
    [ 990.013233] other info that might help us debug this:
    [ 990.013233]
    [ 990.013233] 2 locks held by dbench/1891:
    [ 990.013233] #0: (&sb->s_type->i_mutex_key#12){+.+.+.}, at: [] vfs_setxattr+0x78/0xc0
    [ 990.013233] #1: (&REISERFS_I(inode)->i_xattr_sem){+.+.+.}, at: [] reiserfs_xattr_set_handle+0x8a/0x470
    [ 990.013233]
    [ 990.013233] stack backtrace:
    [ 990.013233] Pid: 1891, comm: dbench Not tainted 2.6.33-rc1 #1
    [ 990.013233] Call Trace:
    [ 990.013233] [] print_circular_bug+0xe9/0xf0
    [ 990.013233] [] __lock_acquire+0x12d0/0x1560
    [ 990.013233] [] ? reiserfs_xattr_set_handle+0x8a/0x470
    [ 990.013233] [] lock_acquire+0x8f/0xb0
    [ 990.013233] [] ? reiserfs_write_lock+0x35/0x50
    [ 990.013233] [] ? reiserfs_xattr_set_handle+0x8a/0x470
    [ 990.013233] [] __mutex_lock_common+0x47/0x3b0
    [ 990.013233] [] ? reiserfs_write_lock+0x35/0x50
    [ 990.013233] [] ? reiserfs_write_lock+0x35/0x50
    [ 990.013233] [] ? mark_held_locks+0x72/0xa0
    [ 990.013233] [] ? __mutex_unlock_slowpath+0xbd/0x140
    [ 990.013233] [] ? trace_hardirqs_on_caller+0x14d/0x1a0
    [ 990.013233] [] mutex_lock_nested+0x3e/0x50
    [ 990.013233] [] reiserfs_write_lock+0x35/0x50
    [ 990.013233] [] reiserfs_prepare_write+0x45/0x180
    [ 990.013233] [] reiserfs_xattr_set_handle+0x2a6/0x470
    [ 990.013233] [] reiserfs_xattr_set+0xb0/0x150
    [ 990.013233] [] ? __mutex_lock_common+0x284/0x3b0
    [ 990.013233] [] user_set+0x8a/0x90
    [ 990.013233] [] reiserfs_setxattr+0xaa/0xb0
    [ 990.013233] [] __vfs_setxattr_noperm+0x36/0xa0
    [ 990.013233] [] vfs_setxattr+0xbc/0xc0
    [ 990.013233] [] setxattr+0xc0/0x150
    [ 990.013233] [] ? sched_clock_cpu+0xb8/0x100
    [ 990.013233] [] ? trace_hardirqs_off+0xd/0x10
    [ 990.013233] [] ? cpu_clock+0x43/0x50
    [ 990.013233] [] ? fget+0xb0/0x110
    [ 990.013233] [] ? fget+0x0/0x110
    [ 990.013233] [] ? sysret_check+0x27/0x62
    [ 990.013233] [] sys_fsetxattr+0x8d/0xa0
    [ 990.013233] [] system_call_fastpath+0x16/0x1b

    Reported-and-tested-by: Christian Kujau
    Signed-off-by: Frederic Weisbecker
    Cc: Alexander Beregalov
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     

01 Jan, 2010

3 commits

  • In the past, ext4_calc_metadata_amount(), and its sub-functions
    ext4_ext_calc_metadata_amount() and ext4_indirect_calc_metadata_amount()
    badly over-estimated the number of metadata blocks that might be
    required for delayed allocation blocks. This didn't matter as much
    when functions which managed the reserved metadata blocks were more
    aggressive about dropping reserved metadata blocks as delayed
    allocation blocks were written, but unfortunately they were too
    aggressive. This was fixed in commit 0637c6f, but as a result the
    over-estimation by ext4_calc_metadata_amount() would lead to reserving
    2-3 times the number of pending delayed allocation blocks as
    potentially required metadata blocks. So if there are 1 megabytes of
    blocks which have been not yet been allocation, up to 3 megabytes of
    space would get reserved out of the user's quota and from the file
    system free space pool until all of the inode's data blocks have been
    allocated.

    This commit addresses this problem by much more accurately estimating
    the number of metadata blocks that will be required. It will still
    somewhat over-estimate the number of blocks needed, since it must make
    a worst case estimate not knowing which physical blocks will be
    needed, but it is much more accurate than before.

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • Commit 0637c6f had a typo which caused the reserved metadata blocks to
    not be released correctly. Fix this.

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    [CIFS] Enable mmap on forcedirectio mounts
    cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS referrals

    Linus Torvalds
     

31 Dec, 2009

3 commits

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: Patch up how we claim metadata blocks for quota purposes
    ext4: Ensure zeroout blocks have no dirty metadata
    ext4: return correct wbc.nr_to_write in ext4_da_writepages
    ext4: Update documentation to correct the inode_readahead_blks option name
    jbd2: don't use __GFP_NOFAIL in journal_init_common()
    ext4: flush delalloc blocks when space is low
    fs-writeback: Add helper function to start writeback if idle
    ext4: Eliminate potential double free on error path
    ext4: fix unsigned long long printk warning in super.c
    ext4, jbd2: Add barriers for file systems with exernal journals
    ext4: replace BUG() with return -EIO in ext4_ext_get_blocks
    ext4: add module aliases for ext2 and ext3
    ext4: Don't ask about supporting ext2/3 in ext4 if ext4 is not configured
    ext4: remove unused #include

    Linus Torvalds
     
  • generic_permission was refusing CAP_DAC_READ_SEARCH-enabled
    processes from opening DAC-protected files read-only, because
    do_filp_open adds MAY_OPEN to the open mask.

    Ignore MAY_OPEN. After this patch, CAP_DAC_READ_SEARCH is
    again sufficient to open(fname, O_RDONLY) on a file to which
    DAC otherwise refuses us read permission.

    Reported-by: Mike Kazantsev
    Signed-off-by: Serge E. Hallyn
    Tested-by: Mike Kazantsev
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • As reported in Kernel Bugzilla #14936, commit d21cd8f triggered a BUG
    in the function ext4_da_update_reserve_space() found in
    fs/ext4/inode.c. The root cause of this BUG() was caused by the fact
    that ext4_calc_metadata_amount() can severely over-estimate how many
    metadata blocks will be needed, especially when using direct
    block-mapped files.

    In addition, it can also badly *under* estimate how much space is
    needed, since ext4_calc_metadata_amount() assumes that the blocks are
    contiguous, and this is not always true. If the application is
    writing blocks to a sparse file, the number of metadata blocks
    necessary can be severly underestimated by the functions
    ext4_da_reserve_space(), ext4_da_update_reserve_space() and
    ext4_da_release_space(). This was the cause of the dq_claim_space
    reports found on kerneloops.org.

    Unfortunately, doing this right means that we need to massively
    over-estimate the amount of free space needed. So in some cases we
    may need to force the inode to be written to disk asynchronously in
    to avoid spurious quota failures.

    http://bugzilla.kernel.org/show_bug.cgi?id=14936

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

30 Dec, 2009

2 commits

  • This fixes a bug (found by Curt Wohlgemuth) in which new blocks
    returned from an extent created with ext4_ext_zeroout() can have dirty
    metadata still associated with them.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Curt Wohlgemuth
    Signed-off-by: "Theodore Ts'o"

    Aneesh Kumar K.V
     
  • Commit 500f5a0bf5f0624dae34307010e240ec090e4cde
    (reiserfs: Fix possible recursive lock) fixed a vmalloc under reiserfs
    lock that triggered a lockdep warning because of a
    IN-FS-RECLAIM RECLAIM-FS-ON locking dependency inversion.

    But this patch has ommitted another vmalloc call in the same path
    that allocates the journal. Relax the lock for this one too.

    Reported-by: Alexander Beregalov
    Signed-off-by: Frederic Weisbecker
    Cc: Chris Mason
    Cc: Ingo Molnar

    Frederic Weisbecker
     

26 Dec, 2009

1 commit

  • When ext4_da_writepages increases the nr_to_write in writeback_control
    then it must always re-base the return value. Originally there was a
    (misguided) attempt prevent wbc.nr_to_write from going negative. In
    fact, it's necessary to allow nr_to_write to be negative so that
    wb_writeback() can correctly calculate how many pages were actually
    written.

    Signed-off-by: Richard Kennedy
    Signed-off-by: "Theodore Ts'o"

    Richard Kennedy
     

25 Dec, 2009

3 commits

  • The C99 specification states in section 6.11.5:

    The placement of a storage-class specifier other than at the beginning
    of the declaration specifiers in a declaration is an obsolescent
    feature.

    Signed-off-by: Tobias Klauser
    Signed-off-by: Ryusuke Konishi

    Tobias Klauser
     
  • This is a trivial style fix patch to mend errors/warnings
    reported by "checkpatch.pl --file".

    Signed-off-by: Jiro SEKIBA
    Signed-off-by: Ryusuke Konishi

    Jiro SEKIBA
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
    ocfs2/trivial: Use le16_to_cpu for a disk value in xattr.c
    ocfs2/trivial: Use proper mask for 2 places in hearbeat.c
    Ocfs2: Let ocfs2 support fiemap for symlink and fast symlink.
    Ocfs2: Should ocfs2 support fiemap for S_IFDIR inode?
    ocfs2: Use FIEMAP_EXTENT_SHARED
    fiemap: Add new extent flag FIEMAP_EXTENT_SHARED
    ocfs2: replace u8 by __u8 in ocfs2_fs.h
    ocfs2: explicit declare uninitialized var in user_cluster_connect()
    ocfs2-devel: remove redundant OCFS2_MOUNT_POSIX_ACL check in ocfs2_get_acl_nolock()
    ocfs2: return -EAGAIN instead of EAGAIN in dlm
    ocfs2/cluster: Make fence method configurable - v2
    ocfs2: Set MS_POSIXACL on remount
    ocfs2: Make acl use the default
    ocfs2: Always include ACL support

    Linus Torvalds
     

24 Dec, 2009

7 commits


23 Dec, 2009

5 commits

  • It triggers the warning in get_page_from_freelist(), and it isn't
    appropriate to use __GFP_NOFAIL here anyway.

    Addresses http://bugzilla.kernel.org/show_bug.cgi?id=14843

    Reported-by: Christian Casteyde
    Signed-off-by: Andrew Morton
    Signed-off-by: "Theodore Ts'o"

    Andrew Morton
     
  • Creating many small files in rapid succession on a small
    filesystem can lead to spurious ENOSPC; on a 104MB filesystem:

    for i in `seq 1 22500`; do
    echo -n > $SCRATCH_MNT/$i
    echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
    done

    leads to ENOSPC even though after a sync, 40% of the fs is free
    again.

    This is because we reserve worst-case metadata for delalloc writes,
    and when data is allocated that worst-case reservation is not
    usually needed.

    When freespace is low, kicking off an async writeback will start
    converting that worst-case space usage into something more realistic,
    almost always freeing up space to continue.

    This resolves the testcase for me, and survives all 4 generic
    ENOSPC tests in xfstests.

    We'll still need a hard synchronous sync to squeeze out the last bit,
    but this fixes things up to a large degree.

    Signed-off-by: Eric Sandeen
    Signed-off-by: "Theodore Ts'o"

    Eric Sandeen
     
  • ext4, at least, would like to start pushing on writeback if it starts
    to get close to ENOSPC when reserving worst-case blocks for delalloc
    writes. Writing out delalloc data will convert those worst-case
    predictions into usually smaller actual usage, freeing up space
    before we hit ENOSPC based on this speculation.

    Thanks to Jens for the suggestion for the helper function,
    & the naming help.

    I've made the helper return status on whether writeback was
    started even though I don't plan to use it in the ext4 patch;
    it seems like it would be potentially useful to test this
    in some cases.

    Signed-off-by: Eric Sandeen
    Acked-by: Jan Kara

    Eric Sandeen
     
  • b_entry_name and buffer are initially NULL, are initialized within a loop
    to the result of calling kmalloc, and are freed at the bottom of this loop.
    The loop contains gotos to cleanup, which also frees b_entry_name and
    buffer. Some of these gotos are before the reinitializations of
    b_entry_name and buffer. To maintain the invariant that b_entry_name and
    buffer are NULL at the top of the loop, and thus acceptable arguments to
    kfree, these variables are now set to NULL after the kfrees.

    This seems to be the simplest solution. A more complicated solution
    would be to introduce more labels in the error handling code at the end of
    the function.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @r@
    identifier E;
    expression E1;
    iterator I;
    statement S;
    @@

    *kfree(E);
    ... when != E = E1
    when != I(E,...) S
    when != &E
    *kfree(E);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: "Theodore Ts'o"

    Julia Lawall
     
  • sparc64 allmodconfig:

    fs/ext4/super.c: In function `lifetime_write_kbytes_show':
    fs/ext4/super.c:2174: warning: long long unsigned int format, long unsigned int arg (arg 4)
    fs/ext4/super.c:2174: warning: long long unsigned int format, long unsigned int arg (arg 4)

    Signed-off-by: Andrew Morton
    Signed-off-by: "Theodore Ts'o"

    Andrew Morton