Skip to content
  1. Jul 22, 2009
    • Eric Paris's avatar
      inotify: use GFP_NOFS under potential memory pressure · f44aebcc
      Eric Paris authored
      
      
      inotify can have a watchs removed under filesystem reclaim.
      
      =================================
      [ INFO: inconsistent lock state ]
      2.6.31-rc2 #16
      ---------------------------------
      inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
      khubd/217 [HC0[0]:SC0[0]:HE1:SE1] takes:
       (iprune_mutex){+.+.?.}, at: [<c10ba899>] invalidate_inodes+0x20/0xe3
      {IN-RECLAIM_FS-W} state was registered at:
        [<c10536ab>] __lock_acquire+0x2c9/0xac4
        [<c1053f45>] lock_acquire+0x9f/0xc2
        [<c1308872>] __mutex_lock_common+0x2d/0x323
        [<c1308c00>] mutex_lock_nested+0x2e/0x36
        [<c10ba6ff>] shrink_icache_memory+0x38/0x1b2
        [<c108bfb6>] shrink_slab+0xe2/0x13c
        [<c108c3e1>] kswapd+0x3d1/0x55d
        [<c10449b5>] kthread+0x66/0x6b
        [<c1003fdf>] kernel_thread_helper+0x7/0x10
        [<ffffffff>] 0xffffffff
      
      Two things are needed to fix this.  First we need a method to tell
      fsnotify_create_event() to use GFP_NOFS and second we need to stop using
      one global IN_IGNORED event and allocate them one at a time.  This solves
      current issues with multiple IN_IGNORED on a queue having tail drop
      problems and simplifies the allocations since we don't have to worry about
      two tasks opperating on the IGNORED event concurrently.
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      f44aebcc
    • Eric Paris's avatar
      fsnotify: fix inotify tail drop check with path entries · c05594b6
      Eric Paris authored
      
      
      fsnotify drops new events when they are the same as the tail event on the
      queue to be sent to userspace.  The problem is that if the event comes with
      a path we forget to break out of the switch statement and fall into the
      code path which matches on events that do not have any type of file backed
      information (things like IN_UNMOUNT and IN_Q_OVERFLOW).  The problem is
      that this code thinks all such events should be dropped.  Fix is to add a
      break.
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      c05594b6
    • Eric Paris's avatar
      inotify: check filename before dropping repeat events · 4a148ba9
      Eric Paris authored
      
      
      inotify drops events if the last event on the queue is the same as the
      current event.  But it does 2 things wrong.  First it is comparing old->inode
      with new->inode.  But after an event if put on the queue the ->inode is no
      longer allowed to be used.  It's possible between the last event and this new
      event the inode could be reused and we would falsely match the inode's memory
      address between two differing events.
      
      The second problem is that when a file is removed fsnotify is passed the
      negative dentry for the removed object rather than the postive dentry from
      immediately before the removal.  This mean the (broken) inotify tail drop code
      was matching the NULL ->inode of differing events.
      
      The fix is to check the file name which is stored with events when doing the
      tail drop instead of wrongly checking the address of the stored ->inode.
      
      Reported-by: default avatarScott James Remnant <scott@ubuntu.com>
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      4a148ba9
    • Eric Paris's avatar
      fsnotify: use def_bool in kconfig instead of letting the user choose · 520dc2a5
      Eric Paris authored
      
      
      fsnotify doens't give the user anything.  If someone chooses inotify or
      dnotify it should build fsnotify, if they don't select one it shouldn't be
      built.  This patch changes fsnotify to be a def_bool=n and makes everything
      else select it.  Also fixes the issue people complained about on lwn where
      gdm hung because they didn't have inotify and they didn't get the inotify
      build option.....
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      520dc2a5
    • Eric Paris's avatar
      inotify: fix error paths in inotify_update_watch · 7e790dd5
      Eric Paris authored
      
      
      inotify_update_watch could leave things in a horrid state on a number of
      error paths.  We could try to remove idr entries that didn't exist, we
      could send an IN_IGNORED to userspace for watches that don't exist, and a
      bit of other stupidity.  Clean these up by doing the idr addition before we
      put the mark on the inode since we can clean that up on error and getting
      off the inode's mark list is hard.
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      7e790dd5
    • Eric Paris's avatar
      inotify: do not leak inode marks in inotify_add_watch · 75fe2b26
      Eric Paris authored
      
      
      inotify_add_watch had a couple of problems.  The biggest being that if
      inotify_add_watch was called on the same inode twice (to update or change the
      event mask) a refence was taken on the original inode mark by
      fsnotify_find_mark_entry but was not being dropped at the end of the
      inotify_add_watch call.  Thus if inotify_rm_watch was called although the mark
      was removed from the inode, the refcnt wouldn't hit zero and we would leak
      memory.
      
      Reported-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      75fe2b26
    • Eric Paris's avatar
      inotify: drop user watch count when a watch is removed · 5549f7cd
      Eric Paris authored
      
      
      The inotify rewrite forgot to drop the inotify watch use cound when a watch
      was removed.  This means that a single inotify fd can only ever register a
      maximum of /proc/sys/fs/max_user_watches even if some of those had been
      freed.
      
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      5549f7cd
  2. Jul 21, 2009
  3. Jul 19, 2009
    • Linus Torvalds's avatar
      Merge master.kernel.org:/home/rmk/linux-2.6-arm · a7571a5c
      Linus Torvalds authored
      * master.kernel.org:/home/rmk/linux-2.6-arm:
        ARM: Realview & Versatile: Fix i2c_board_info definitions
        [ARM] 5608/1: Updated U300 defconfig
        [ARM] 5606/1: Fix ep93xx watchdog driver headers
        [ARM] 5594/1: Correct U300 VIC init PM setting
        [ARM] 5595/1: ep93xx: missing header in dma-m2p.c
        [ARM] Kirkwood: Correct header define
        [ARM] pxa: fix ULPI_{DIR,NXT,STP} MFP defines
        backlight: fix pwm_bl.c to notify platform code when suspending
        [ARM] pxa: use kzalloc() in pxa_init_gpio_chip()
        [ARM] pxa: correct I2CPWR clock for pxa3xx
        pxamci: correct DMA flow control
        ARM: add support for the EET board, based on the i.MX31 pcm037 module
        pcm037: add MT9T031 camera support
        Armadillo 500 add NAND flash device support (resend).
        ARM MXC: Armadillo 500 add NOR flash device support (resend).
        mx31: remove duplicated #include
      a7571a5c
    • Russell King's avatar
      ARM: Realview & Versatile: Fix i2c_board_info definitions · 64e8be6e
      Russell King authored
      
      
      Fix i2c_board_info definitions - we were defining the 'type' field
      of these structures twice since the first argument of I2C_BOARD_INFO
      sets this field.  Move the second definition into I2C_BOARD_INFO().
      
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: default avatarJean Delvare <khali@linux-fr.org>
      Acked-by: default avatarBen Dooks <ben-linux@fluff.org>
      64e8be6e
  4. Jul 18, 2009
  5. Jul 17, 2009