Skip to content
  1. Jul 21, 2009
  2. Jul 16, 2009
    • Jan Kara's avatar
      ext3: Get rid of extenddisksize parameter of ext3_get_blocks_handle() · 43237b54
      Jan Kara authored
      
      
      Get rid of extenddisksize parameter of ext3_get_blocks_handle(). This seems to
      be a relict from some old days and setting disksize in this function does not
      make much sence. Currently it was set only by ext3_getblk().  Since the
      parameter has some effect only if create == 1, it is easy to check that the
      three callers which end up calling ext3_getblk() with create == 1 (ext3_append,
      ext3_quota_write, ext3_mkdir) do the right thing and set disksize themselves.
      
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      43237b54
    • Jan Kara's avatar
      jbd: Fix a race between checkpointing code and journal_get_write_access() · 1e9fd53b
      Jan Kara authored
      
      
      The following race can happen:
      
        CPU1                          CPU2
                                      checkpointing code checks the buffer, adds
                                        it to an array for writeback
      do_get_write_access()
        ...
        lock_buffer()
        unlock_buffer()
                                        flush_batch() submits the buffer for IO
        __jbd_journal_file_buffer()
      
        So a buffer under writeout is returned from do_get_write_access(). Since
      the filesystem code relies on the fact that journaled buffers cannot be
      written out, it does not take the buffer lock and so it can modify buffer
      while it is under writeout. That can lead to a filesystem corruption
      if we crash at the right moment. The similar problem can happen with
      the journal_get_create_access() path.
        We fix the problem by clearing the buffer dirty bit under buffer_lock
      even if the buffer is on BJ_None list. Actually, we clear the dirty bit
      regardless the list the buffer is in and warn about the fact if
      the buffer is already journalled.
      
      Thanks for spotting the problem goes to dingdinghua <dingdinghua85@gmail.com>.
      
      Reported-by: default avatardingdinghua <dingdinghua85@gmail.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      1e9fd53b
    • Jan Kara's avatar
      ext3: Fix truncation of symlinks after failed write · 9eaaa2d5
      Jan Kara authored
      
      
      Contents of long symlinks is written via standard write methods. So when the
      write fails, we add inode to orphan list. But symlinks don't have .truncate
      method defined so nobody properly removes them from the orphan list (both on
      disk and in memory).
      
      Fix this by calling ext3_truncate() directly instead of calling vmtruncate()
      (which is saner anyway since we don't need anything vmtruncate() does except
      from calling .truncate in these paths).  We also add inode to orphan list only
      if ext3_can_truncate() is true (currently, it can be false for symlinks when
      there are no blocks allocated) - otherwise orphan list processing will complain
      and ext3_truncate() will not remove inode from on-disk orphan list.
      
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      9eaaa2d5
    • Jan Kara's avatar
      jbd: Fail to load a journal if it is too short · 7447a668
      Jan Kara authored
      
      
      Due to on disk corruption, it can happen that journal is too short. Fail
      to load it in such case so that we don't oops somewhere later.
      
      Reported-by: default avatarNageswara R Sastry <rnsastry@linux.vnet.ibm.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      7447a668
  3. Jul 15, 2009
  4. Jul 14, 2009
  5. Jul 13, 2009
    • Theodore Ts'o's avatar
      ext4: Fix ext4_mb_initialize_context() to initialize all fields · 833576b3
      Theodore Ts'o authored
      
      
      Pavel Roskin pointed out that kmemcheck indicated that
      ext4_mb_store_history() was accessing uninitialized values of
      ac->ac_tail and ac->ac_buddy leading to garbage in the mballoc
      history.  Fix this by initializing the entire structure to all zeros
      first.
      
      Also, two fields were getting doubly initialized by the caller of
      ext4_mb_initialize_context, so remove them for efficiency's sake.
      
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      833576b3
    • Peng Tao's avatar
      ext4: fix null handler of ioctls in no journal mode · ac046f1d
      Peng Tao authored
      
      
      The EXT4_IOC_GROUP_ADD and EXT4_IOC_GROUP_EXTEND ioctls should not
      flush the journal in no_journal mode.  Otherwise, running resize2fs on
      a mounted no_journal partition triggers the following error messages:
      
      BUG: unable to handle kernel NULL pointer dereference at 00000014
      IP: [<c039d282>] _spin_lock+0x8/0x19
      *pde = 00000000 
      Oops: 0002 [#1] SMP
      
      Signed-off-by: default avatarPeng Tao <bergwolf@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      ac046f1d
    • Curt Wohlgemuth's avatar
      ext4: Fix buffer head reference leak in no-journal mode · e6b5d301
      Curt Wohlgemuth authored
      
      
      We found a problem with buffer head reference leaks when using an ext4
      partition without a journal.  In particular, calls to ext4_forget() would
      not to a brelse() on the input buffer head, which will cause pages they
      belong to to not be reclaimable.
      
      Further investigation showed that all places where ext4_journal_forget() and
      ext4_journal_revoke() are called are subject to the same problem.  The patch
      below changes __ext4_journal_forget/__ext4_journal_revoke to do an explicit
      release of the buffer head when the journal handle isn't valid.
      
      Signed-off-by: default avatarCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      e6b5d301
    • Rakib Mullick's avatar
      x86, apic: Fix false positive section mismatch in numaq_32.c · 7473727b
      Rakib Mullick authored
      
      
      The variable apic_numaq placed in noninit section references the
      function wakeup_secondary_cpu_via_nmi(), which is in __cpuinit
      section. Thus causes a section mismatch warning. To avoid such
      mismatch we mark apic_numaq as __refdata.
      
      We were warned by the following warning:
      
        WARNING: arch/x86/kernel/built-in.o(.data+0x932c): Section mismatch in
        reference from the variable apic_numaq to the function
        .cpuinit.text:wakeup_secondary_cpu_via_nmi()
      
      Signed-off-by: default avatarRakib Mullick <rakib.mullick@gmail.com>
      LKML-Reference: <b9df5fa10907120407p6b4f67dtf4d563155488188a@mail.gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7473727b
    • Rakib Mullick's avatar
      x86: Fix false positive section mismatch in es7000_32.c · 151586d0
      Rakib Mullick authored
      
      
      The variable apic_es7000_cluster references the function __cpuinit
      wakeup_secondary_cpu_via_mip() from a noninit section. So we've been
      warned by the following warning. To avoid possible collision between
      init/noninit, its best to mark the variable as __refdata.
      
      We were warned by the following warning:
      
        LD      arch/x86/kernel/apic/built-in.o
        WARNING: arch/x86/kernel/apic/built-in.o(.data+0x198c): Section
        mismatch in reference from the variable apic_es7000_cluster to the
        function .cpuinit.text:wakeup_secondary_cpu_via_mip()
      
      Signed-off-by: default avatarRakib Mullick <rakib.mullick@gmail.com>
      LKML-Reference: <b9df5fa10907120404k6279a10ch5e9682432272706f@mail.gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      151586d0
    • Steven Rostedt's avatar
      tracing/function-profiler: do not free per cpu variable stat · 6ab5d668
      Steven Rostedt authored
      
      
      The per cpu variable stat is freeded if we fail to allocate a name
      on start up. This was due to stat at first being allocated in the
      initial design. But since then, it has become a static per cpu variable
      but the free on error was not removed.
      
      Also added __init annotation to the function that this is in.
      
      [ Impact: prevent possible memory corruption on low mem at boot up ]
      
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6ab5d668