1. 02 Feb, 2012 2 commits
    • Yinghai Lu's avatar
      drivers/base/memory.c: fix memory_dev_init() long delay · 321bf4ed
      Yinghai Lu authored
      One system with 2048g ram, reported soft lockup on recent kernel.
      
      [   34.426749] cpu_dev_init done
      [   61.166399] BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]
      [   61.166733] Modules linked in:
      [   61.166904] irq event stamp: 1935610
      [   61.178431] hardirqs last  enabled at (1935609): [<ffffffff81ce8c05>] mutex_lock_nested+0x299/0x2b4
      [   61.178923] hardirqs last disabled at (1935610): [<ffffffff81cf2bab>] apic_timer_interrupt+0x6b/0x80
      [   61.198767] softirqs last  enabled at (1935476): [<ffffffff8106e59c>] __do_softirq+0x195/0x1ab
      [   61.218604] softirqs last disabled at (1935471): [<ffffffff81cf359c>] call_softirq+0x1c/0x30
      [   61.238408] CPU 0
      [   61.238549] Modules linked in:
      [   61.238744]
      [   61.238825] Pid: 1, comm: swapper/0 Not tainted 3.3.0-rc1-tip-yh-02076-g962f689-dirty #171
      [   61.278212] RIP: 0010:[<ffffffff810b3e3a>]  [<ffffffff810b3e3a>] lock_release+0x90/0x9c
      [   61.278627] RSP: 0018:ffff883f64dbfd70  EFLAGS: 00000246
      [   61.298287] RAX: ffff883f64dc0000 RBX: 0000000000000000 RCX: 000000000000008b
      [   61.298690] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
      [   61.318383] RBP: ffff883f64dbfda0 R08: 0000000000000001 R09: 000000000000008b
      [   61.338215] R10: 0000000000000000 R11: 0000000000000000 R12: ffff883f64dbfd10
      [   61.338610] R13: ffff883f64dc0708 R14: ffff883f64dc0708 R15: ffffffff81095657
      [   61.358299] FS:  0000000000000000(0000) GS:ffff883f7d600000(0000) knlGS:0000000000000000
      [   61.378118] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [   61.378450] CR2: 0000000000000000 CR3: 00000000024af000 CR4: 00000000000007f0
      [   61.398144] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   61.417918] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [   61.418260] Process swapper/0 (pid: 1, threadinfo ffff883f64dbe000, task ffff883f64dc0000)
      [   61.445358] Stack:
      [   61.445511]  0000000000000002 ffff897f649ba168 ffff883f64dbfe10 ffff88ff64bb57a8
      [   61.458040]  0000000000000000 0000000000000000 ffff883f64dbfdc0 ffffffff81ceb1b4
      [   61.458491]  000000000011608c ffff88ff64bb58a8 ffff883f64dbfdf0 ffffffff81c57638
      [   61.478215] Call Trace:
      [   61.478367]  [<ffffffff81ceb1b4>] _raw_spin_unlock+0x21/0x2e
      [   61.497994]  [<ffffffff81c57638>] klist_next+0x9e/0xbc
      [   61.498264]  [<ffffffff8148ba99>] next_device+0xe/0x1e
      [   61.517867]  [<ffffffff8148c0cc>] subsys_find_device_by_id+0xb7/0xd6
      [   61.518197]  [<ffffffff81498846>] find_memory_block_hinted+0x3d/0x66
      [   61.537927]  [<ffffffff8149887f>] find_memory_block+0x10/0x12
      [   61.538193]  [<ffffffff814988b6>] add_memory_section+0x35/0x9e
      [   61.557932]  [<ffffffff827fecef>] memory_dev_init+0x68/0xda
      [   61.558227]  [<ffffffff827fec01>] driver_init+0x97/0xa7
      [   61.577853]  [<ffffffff827cdf3c>] kernel_init+0xf6/0x1c0
      [   61.578140]  [<ffffffff81cf34a4>] kernel_thread_helper+0x4/0x10
      [   61.597850]  [<ffffffff81ceb59d>] ? retint_restore_args+0xe/0xe
      [   61.598144]  [<ffffffff827cde46>] ? start_kernel+0x3ab/0x3ab
      [   61.617826]  [<ffffffff81cf34a0>] ? gs_change+0xb/0xb
      [   61.618060] Code: 10 48 83 3b 00 eb e8 4c 89 f2 44 89 fe 4c 89 ef e8 e1 fe ff ff 65 48 8b 04 25 40 bc 00 00 c7 80 cc 06 00 00 00 00 00 00 41 54 9d <5e> 5b 41 5c 41 5d 41 5e 41 5f 5d c3 55 48 89 e5 41 57 41 89 cf
      [   89.285380] memory_dev_init done
      
      Finally it takes about 55s to create 16400 memory entries.
      
      Root cause: for x86_64, 2048g (with 2g hole at [2g,4g), and TOP2 will be 2050g), will have 16400 memory block.
      
      find_memory_block/subsys_find_device_by_id will be expensive with that many entries.
      
      Actually, we don't need to find that memory block for BOOT path.
      
      Skip that finding make it get back to normal.
      
      [   34.466696] cpu_dev_init done
      [   35.290080] memory_dev_init done
      
      Also solved the delay with topology_init when sections_per_block is not 1.
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Nathan Fontenot <nfont@austin.ibm.com>
      Cc: Robin Holt <holt@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      321bf4ed
    • Greg Kroah-Hartman's avatar
      driver core: cpu: remove kernel warning when removing a cpu · 2885e25c
      Greg Kroah-Hartman authored
      With the movement of the cpu sysdev code to be real stuct devices, now
      when we remove a cpu from the system, the driver core rightfully
      complains that there is not a release method for this device.
      
      For now, paper over this issue by quieting the driver core, but comment
      this in detail.  This will be resolved in future kernels to be solved
      properly.
      Reported-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Tested-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2885e25c
  2. 31 Jan, 2012 4 commits
    • Linus Torvalds's avatar
      Linux 3.3-rc2 · 62aa2b53
      Linus Torvalds authored
      62aa2b53
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream · d3712b9d
      Linus Torvalds authored
      There are few important bug fixes for LogFS
      
      * tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream:
        Logfs: Allow NULL block_isbad() methods
        logfs: Grow inode in delete path
        logfs: Free areas before calling generic_shutdown_super()
        logfs: remove useless BUG_ON
        MAINTAINERS: Add Prasad Joshi in LogFS maintiners
        logfs: Propagate page parameter to __logfs_write_inode
        logfs: set superblock shutdown flag after generic sb shutdown
        logfs: take write mutex lock during fsync and sync
        logfs: Prevent memory corruption
        logfs: update page reference count for pined pages
      
      Fix up conflict in fs/logfs/dev_mtd.c due to semantic change in what
      "mtd->block_isbad" means in commit f2933e86: "Logfs: Allow NULL
      block_isbad() methods" clashing with the abstraction changes in the
      commits 7086c19d: "mtd: introduce mtd_block_isbad interface" and
      d58b27ed: "logfs: do not use 'mtd->block_isbad' directly".
      
      This resolution takes the semantics from commit f2933e86, and just
      makes mtd_block_isbad() return zero (false) if the 'block_isbad'
      function is NULL.  But that also means that now "mtd_can_have_bb()"
      always returns 0.
      
      Now, "mtd_block_markbad()" will obviously return an error if the
      low-level driver doesn't support bad blocks, so this is somewhat
      non-symmetric, but it actually makes sense if a NULL "block_isbad"
      function is considered to mean "I assume that all my blocks are always
      good".
      d3712b9d
    • Linus Torvalds's avatar
      Merge branch 'hwmon-for-linus' of... · c5d2bc11
      Linus Torvalds authored
      Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
        hwmon: (sht15) fix bad error code
        MAINTAINERS: Drop maintainer for MAX1668 hwmon driver
        MAINTAINERS: Add hwmon entries for Wolfson
        hwmon: (f71805f) Fix clamping of temperature limits
      c5d2bc11
    • Linus Torvalds's avatar
      Merge branch 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 8e2a2880
      Linus Torvalds authored
      Here are some fixes to the pin control system that has accumulated since
      -rc1.  Mainly Tony Lindgren fixed the module load/unload logic and the
      rest are minor fixes and documentation.
      
      * 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: add checks for empty function names
        pinctrl: fix pinmux_hog_maps when ctrl_dev_name is not set
        pinctrl: fix some pinmux typos
        pinctrl: free debugfs entries when unloading a pinmux driver
        pinctrl: unbreak error messages
        Documentation/pinctrl: fix a few syntax errors in code examples
        pinctrl: fix pinconf_pins_show iteration
      8e2a2880
  3. 30 Jan, 2012 16 commits
  4. 29 Jan, 2012 8 commits
  5. 28 Jan, 2012 10 commits
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · deb9b4ce
      Linus Torvalds authored
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: (31 commits)
        ARM: 7304/1: ioremap: fix boundary check when reusing static mapping
        ARM: 7301/1: Rename the T() macro to TUSER() to avoid namespace conflicts
        ARM: 7299/1: ftrace: clear zero bit in reported IPs for Thumb-2
        ARM: 7298/1: realview: fix mapping of MPCore private memory region
        PCMCIA: fix sa1111 oops on remove
        ARM: 7288/1: mach-sa1100: add missing module_init() call
        ARM: 7297/1: smp_twd: make sure timer is stopped before registering it
        ARM: 7296/1: proc-v7.S: remove HARVARD_CACHE preprocessor guards
        ARM: 7295/1: cortex-a7: move proc_info out of !CONFIG_ARM_LPAE block
        ARM: 7293/1: logical_cpu_map: decouple CPU mapping from SMP
        ARM: 7291/1: cache: assume 64-byte L1 cachelines for ARMv7 CPUs
        ARM: 7290/1: vmlinux.lds.S: align the exception fixup table to a 4-byte boundary
        ARM: 7289/1: vmlinux.lds.S: do not hardcode cacheline size as 32 bytes
        MFD: ucb1x00-ts: fix resume failure
        MFD: ucb1x00-core: fix gpiolib direction_output handling
        MFD: ucb1x00-core: fix missing restore of io output data on resume
        MFD: mcp-core: fix mcp_priv() to be more type safe
        MFD: mcp-core: fix complaints from the genirq layer
        Revert "ARM: sa11x0: Implement autoloading of codec and codec pdata for mcp bus."
        Revert "ARM: sa1100: Refactor mcp-sa11x0 to use platform resources."
        ...
      
      Fix up conflict due to arch/arm/mach-mx5/Kconfig having been merged into
      mach-imx5 (commit 784a90c0: "ARM i.MX: Merge i.MX5 support into
      mach-imx"), but the ARM_L1_CACHE_SHIFT_6 entry was moved to be driven by
      the CPU_V7 logic from it in the old location in rmk's branch (commit
      a092f2b1: "ARM: 7291/1: cache: assume 64-byte L1 cachelines for
      ARMv7 CPUs").
      deb9b4ce
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 81bc3009
      Linus Torvalds authored
      arm-soc fixes for 3.3-rc:
      
      AT91 needed reset fixes which resulted in some minor code refactoring,
      it also adds a feature-removal for one of their platforms for 3.4.
      The USB patches have been acked by Greg K-H.
      
      i.MX and ux500 both have some minor fixes, nothing controversial.
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        arch/arm/mach-imx/mach-mx53_ard.c: add missing iounmap
        ARM: imx: iomux-v1.h: Fix build error due to __init annotation
        ARM: at91: Fix at91sam9g45 and at91cap9 reset
        ARM: at91: make rstc soc independent
        ARM: at91: introduce AT91_SAM9_ALT_RESET to select the at91sam9 alternative reset
        ARM: at91: merge at91cap9_ddrsdr.h in at91sam9_ddrsdr.h
        ARM: at91: fix cap9 ddrsdr register
        ARM/USB: at91/ohci-at91: rename vbus_pin_inverted to vbus_pin_active_low
        USB: at91: fix clk_get error handling
        ARM: at91: removal of CAP9 SoC family
        ARM: at91: fix at91rm9200 soc subtype handling
        mach-ux500: no MMC_CAP_SD_HIGHSPEED on Snowball
        mach-ux500: enable ARM errata 764369
        mach-ux500: do not override outer.inv_all
        mach-ux500: musb: now musb is always in OTG mode
        ARM: imx6: add missing twd_clk for imx6q clock
      81bc3009
    • Joern Engel's avatar
      Logfs: Allow NULL block_isbad() methods · f2933e86
      Joern Engel authored
      Not all mtd drivers define block_isbad().  Let's assume no bad blocks
      instead of refusing to mount.
      Signed-off-by: default avatarJoern Engel <joern@logfs.org>
      f2933e86
    • Joern Engel's avatar
      logfs: Grow inode in delete path · bbe01387
      Joern Engel authored
      Can be necessary if an inode gets deleted (through -ENOSPC) before being
      written.  Might be better to move this into logfs_write_rec(), but for
      now go with the stupid&safe patch.
      Signed-off-by: default avatarJoern Engel <joern@logfs.org>
      bbe01387
    • Joern Engel's avatar
      logfs: Free areas before calling generic_shutdown_super() · 1bcceaff
      Joern Engel authored
      Or hit an assertion in map_invalidatepage() instead.
      Signed-off-by: default avatarJoern Engel <joern@logfs.org>
      1bcceaff
    • Joern Engel's avatar
      logfs: remove useless BUG_ON · 6c69494f
      Joern Engel authored
      It prevents write sizes >4k.
      Signed-off-by: default avatarJoern Engel <joern@logfs.org>
      6c69494f
    • Prasad Joshi's avatar
    • Prasad Joshi's avatar
      logfs: Propagate page parameter to __logfs_write_inode · 0bd90387
      Prasad Joshi authored
      During GC LogFS has to rewrite each valid block to a separate segment.
      Rewrite operation reads data from an old segment and writes it to a
      newly allocated segment. Since every write operation changes data
      block pointers maintained in inode, inode should also be rewritten.
      
      In GC path to avoid AB-BA deadlock LogFS marks a page with
      PG_pre_locked in addition to locking the page (PG_locked). The page
      lock is ignored iff the page is pre-locked.
      
      LogFS uses a special file called segment file. The segment file
      maintains an 8 bytes entry for every segment. It keeps track of erase
      count, level etc. for every segment.
      
      Bad things happen with a segment belonging to the segment file is GCed
      
       ------------[ cut here ]------------
      kernel BUG at /home/prasad/logfs/readwrite.c:297!
      invalid opcode: 0000 [#1] SMP
      Modules linked in: logfs joydev usbhid hid psmouse e1000 i2c_piix4
      		serio_raw [last unloaded: logfs]
      Pid: 20161, comm: mount Not tainted 3.1.0-rc3+ #3 innotek GmbH
      		VirtualBox
      EIP: 0060:[<f809132a>] EFLAGS: 00010292 CPU: 0
      EIP is at logfs_lock_write_page+0x6a/0x70 [logfs]
      EAX: 00000027 EBX: f73f5b20 ECX: c16007c8 EDX: 00000094
      ESI: 00000000 EDI: e59be6e4 EBP: c7337b28 ESP: c7337b18
      DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      Process mount (pid: 20161, ti=c7336000 task=eb323f70 task.ti=c7336000)
      Stack:
      f8099a3d c7337b24 f73f5b20 00001002 c7337b50 f8091f6d f8099a4d f80994e4
      00000003 00000000 c7337b68 00000000 c67e4400 00001000 c7337b80 f80935e5
      00000000 00000000 00000000 00000000 e1fcf000 0000000f e59be618 c70bf900
      Call Trace:
      [<f8091f6d>] logfs_get_write_page.clone.16+0xdd/0x100 [logfs]
      [<f80935e5>] logfs_mod_segment_entry+0x55/0x110 [logfs]
      [<f809460d>] logfs_get_segment_entry+0x1d/0x20 [logfs]
      [<f8091060>] ? logfs_cleanup_journal+0x50/0x50 [logfs]
      [<f809521b>] ostore_get_erase_count+0x1b/0x40 [logfs]
      [<f80965b8>] logfs_open_area+0xc8/0x150 [logfs]
      [<c141a7ec>] ? kmemleak_alloc+0x2c/0x60
      [<f809668e>] __logfs_segment_write.clone.16+0x4e/0x1b0 [logfs]
      [<c10dd563>] ? mempool_kmalloc+0x13/0x20
      [<c10dd563>] ? mempool_kmalloc+0x13/0x20
      [<f809696f>] logfs_segment_write+0x17f/0x1d0 [logfs]
      [<f8092e8c>] logfs_write_i0+0x11c/0x180 [logfs]
      [<f8092f35>] logfs_write_direct+0x45/0x90 [logfs]
      [<f80934cd>] __logfs_write_buf+0xbd/0xf0 [logfs]
      [<c102900e>] ? kmap_atomic_prot+0x4e/0xe0
      [<f809424b>] logfs_write_buf+0x3b/0x60 [logfs]
      [<f80947a9>] __logfs_write_inode+0xa9/0x110 [logfs]
      [<f8094cb0>] logfs_rewrite_block+0xc0/0x110 [logfs]
      [<f8095300>] ? get_mapping_page+0x10/0x60 [logfs]
      [<f8095aa0>] ? logfs_load_object_aliases+0x2e0/0x2f0 [logfs]
      [<f808e57d>] logfs_gc_segment+0x2ad/0x310 [logfs]
      [<f808e62a>] __logfs_gc_once+0x4a/0x80 [logfs]
      [<f808ed43>] logfs_gc_pass+0x683/0x6a0 [logfs]
      [<f8097a89>] logfs_mount+0x5a9/0x680 [logfs]
      [<c1126b21>] mount_fs+0x21/0xd0
      [<c10f6f6f>] ? __alloc_percpu+0xf/0x20
      [<c113da41>] ? alloc_vfsmnt+0xb1/0x130
      [<c113db4b>] vfs_kern_mount+0x4b/0xa0
      [<c113e06e>] do_kern_mount+0x3e/0xe0
      [<c113f60d>] do_mount+0x34d/0x670
      [<c10f2749>] ? strndup_user+0x49/0x70
      [<c113fcab>] sys_mount+0x6b/0xa0
      [<c142d87c>] syscall_call+0x7/0xb
      Code: f8 e8 8b 93 39 c9 8b 45 f8 3e 0f ba 28 00 19 d2 85 d2 74 ca eb d0 0f 0b 8d 45 fc 89 44 24 04 c7 04 24 3d 9a 09 f8 e8 09 92 39 c9 <0f> 0b 8d 74 26 00 55 89 e5 3e 8d 74 26 00 8b 10 80 e6 01 74 09
      EIP: [<f809132a>] logfs_lock_write_page+0x6a/0x70 [logfs] SS:ESP 0068:c7337b18
      ---[ end trace 96e67d5b3aa3d6ca ]---
      
      The patch passes locked page to __logfs_write_inode. It calls function
      logfs_get_wblocks() to pre-lock the page. This ensures any further
      attempts to lock the page are ignored (esp from get_erase_count).
      Acked-by: default avatarJoern Engel <joern@logfs.org>
      Signed-off-by: default avatarPrasad Joshi <prasadjoshi.linux@gmail.com>
      0bd90387
    • Prasad Joshi's avatar
      logfs: set superblock shutdown flag after generic sb shutdown · ecfd8909
      Prasad Joshi authored
      While unmounting the file system LogFS calls generic_shutdown_super.
      The function does file system independent superblock shutdown.
      However, it might result in call file system specific inode eviction.
      
      LogFS marks FS shutting down by setting bit LOGFS_SB_FLAG_SHUTDOWN in
      super->s_flags. Since, inode eviction might call truncate on inode,
      following BUG is observed when file system is unmounted:
      
      ------------[ cut here ]------------
      kernel BUG at /home/prasad/logfs/segment.c:362!
      invalid opcode: 0000 [#1] PREEMPT SMP
      CPU 3
      Modules linked in: logfs binfmt_misc ppdev virtio_blk parport_pc lp
      	parport psmouse floppy virtio_pci serio_raw virtio_ring virtio
      
      Pid: 1933, comm: umount Not tainted 3.0.0+ #4 Bochs Bochs
      RIP: 0010:[<ffffffffa008c841>]  [<ffffffffa008c841>]
      		logfs_segment_write+0x211/0x230 [logfs]
      RSP: 0018:ffff880062d7b9e8  EFLAGS: 00010202
      RAX: 000000000000000e RBX: ffff88006eca9000 RCX: 0000000000000000
      RDX: ffff88006fd87c40 RSI: ffffea00014ff468 RDI: ffff88007b68e000
      RBP: ffff880062d7ba48 R08: 8000000020451430 R09: 0000000000000000
      R10: dead000000100100 R11: 0000000000000000 R12: ffff88006fd87c40
      R13: ffffea00014ff468 R14: ffff88005ad0a460 R15: 0000000000000000
      FS:  00007f25d50ea760(0000) GS:ffff88007fd80000(0000)
      	knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 0000000000d05e48 CR3: 0000000062c72000 CR4: 00000000000006e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process umount (pid: 1933, threadinfo ffff880062d7a000,
      	task ffff880070b44500)
      Stack:
      ffff880062d7ba38 ffff88005ad0a508 0000000000001000 0000000000000000
      8000000020451430 ffffea00014ff468 ffff880062d7ba48 ffff88005ad0a460
      ffff880062d7bad8 ffffea00014ff468 ffff88006fd87c40 0000000000000000
      Call Trace:
      [<ffffffffa0088fee>] logfs_write_i0+0x12e/0x190 [logfs]
      [<ffffffffa0089360>] __logfs_write_rec+0x140/0x220 [logfs]
      [<ffffffffa0089312>] __logfs_write_rec+0xf2/0x220 [logfs]
      [<ffffffffa00894a4>] logfs_write_rec+0x64/0xd0 [logfs]
      [<ffffffffa0089616>] __logfs_write_buf+0x106/0x110 [logfs]
      [<ffffffffa008a19e>] logfs_write_buf+0x4e/0x80 [logfs]
      [<ffffffffa008a6b8>] __logfs_write_inode+0x98/0x110 [logfs]
      [<ffffffffa008a7c4>] logfs_truncate+0x54/0x290 [logfs]
      [<ffffffffa008abfc>] logfs_evict_inode+0xdc/0x190 [logfs]
      [<ffffffff8115eef5>] evict+0x85/0x170
      [<ffffffff8115f126>] iput+0xe6/0x1b0
      [<ffffffff8115b4a8>] shrink_dcache_for_umount_subtree+0x218/0x280
      [<ffffffff8115ce91>] shrink_dcache_for_umount+0x51/0x90
      [<ffffffff8114796c>] generic_shutdown_super+0x2c/0x100
      [<ffffffffa008cc47>] logfs_kill_sb+0x57/0xf0 [logfs]
      [<ffffffff81147de5>] deactivate_locked_super+0x45/0x70
      [<ffffffff811487ea>] deactivate_super+0x4a/0x70
      [<ffffffff81163934>] mntput_no_expire+0xa4/0xf0
      [<ffffffff8116469f>] sys_umount+0x6f/0x380
      [<ffffffff814dd46b>] system_call_fastpath+0x16/0x1b
      Code: 55 c8 49 8d b6 a8 00 00 00 45 89 f9 45 89 e8 4c 89 e1 4c 89 55
      b8 c7 04 24 00 00 00 00 e8 68 fc ff ff 4c 8b 55 b8 e9 3c ff ff ff <0f>
      0b 0f 0b c7 45 c0 00 00 00 00 e9 44 fe ff ff 66 66 66 66 66
      RIP  [<ffffffffa008c841>] logfs_segment_write+0x211/0x230 [logfs]
      RSP <ffff880062d7b9e8>
      ---[ end trace fe6b040cea952290 ]---
      
      Therefore, move super->s_flags setting after the fs-indenpendent work
      has been finished.
      Reviewed-by: default avatarJoern Engel <joern@logfs.org>
      Signed-off-by: default avatarPrasad Joshi <prasadjoshi.linux@gmail.com>
      ecfd8909
    • Prasad Joshi's avatar
      logfs: take write mutex lock during fsync and sync · 13ced29c
      Prasad Joshi authored
      LogFS uses super->s_write_mutex while writing data to disk. Taking the
      same mutex lock in sync and fsync code path solves the following BUG:
      
      ------------[ cut here ]------------
      kernel BUG at /home/prasad/logfs/dev_bdev.c:134!
      
      Pid: 2387, comm: flush-253:16 Not tainted 3.0.0+ #4 Bochs Bochs
      RIP: 0010:[<ffffffffa007deed>]  [<ffffffffa007deed>]
                      bdev_writeseg+0x25d/0x270 [logfs]
      Call Trace:
      [<ffffffffa007c381>] logfs_open_area+0x91/0x150 [logfs]
      [<ffffffff8128dcb2>] ? find_level.clone.9+0x62/0x100
      [<ffffffffa007c49c>] __logfs_segment_write.clone.20+0x5c/0x190 [logfs]
      [<ffffffff810ef005>] ? mempool_kmalloc+0x15/0x20
      [<ffffffff810ef383>] ? mempool_alloc+0x53/0x130
      [<ffffffffa007c7a4>] logfs_segment_write+0x1d4/0x230 [logfs]
      [<ffffffffa0078f8e>] logfs_write_i0+0x12e/0x190 [logfs]
      [<ffffffffa0079300>] __logfs_write_rec+0x140/0x220 [logfs]
      [<ffffffffa0079444>] logfs_write_rec+0x64/0xd0 [logfs]
      [<ffffffffa00795b6>] __logfs_write_buf+0x106/0x110 [logfs]
      [<ffffffffa007a13e>] logfs_write_buf+0x4e/0x80 [logfs]
      [<ffffffffa0073e33>] __logfs_writepage+0x23/0x80 [logfs]
      [<ffffffffa007410c>] logfs_writepage+0xdc/0x110 [logfs]
      [<ffffffff810f5ba7>] __writepage+0x17/0x40
      [<ffffffff810f6208>] write_cache_pages+0x208/0x4f0
      [<ffffffff810f5b90>] ? set_page_dirty+0x70/0x70
      [<ffffffff810f653a>] generic_writepages+0x4a/0x70
      [<ffffffff810f75d1>] do_writepages+0x21/0x40
      [<ffffffff8116b9d1>] writeback_single_inode+0x101/0x250
      [<ffffffff8116bdbd>] writeback_sb_inodes+0xed/0x1c0
      [<ffffffff8116c5fb>] writeback_inodes_wb+0x7b/0x1e0
      [<ffffffff8116cc23>] wb_writeback+0x4c3/0x530
      [<ffffffff814d984d>] ? sub_preempt_count+0x9d/0xd0
      [<ffffffff8116cd6b>] wb_do_writeback+0xdb/0x290
      [<ffffffff814d984d>] ? sub_preempt_count+0x9d/0xd0
      [<ffffffff814d6208>] ? _raw_spin_unlock_irqrestore+0x18/0x40
      [<ffffffff8105aa5a>] ? del_timer+0x8a/0x120
      [<ffffffff8116cfac>] bdi_writeback_thread+0x8c/0x2e0
      [<ffffffff8116cf20>] ? wb_do_writeback+0x290/0x290
      [<ffffffff8106d2e6>] kthread+0x96/0xa0
      [<ffffffff814de514>] kernel_thread_helper+0x4/0x10
      [<ffffffff8106d250>] ? kthread_worker_fn+0x190/0x190
      [<ffffffff814de510>] ? gs_change+0xb/0xb
      RIP  [<ffffffffa007deed>] bdev_writeseg+0x25d/0x270 [logfs]
      ---[ end trace 0211ad60a57657c4 ]---
      Reviewed-by: default avatarJoern Engel <joern@logfs.org>
      Signed-off-by: default avatarPrasad Joshi <prasadjoshi.linux@gmail.com>
      13ced29c