1. 12 6月, 2009 2 次提交
    • C
      push BKL down into ->put_super · 6cfd0148
      Christoph Hellwig 提交于
      Move BKL into ->put_super from the only caller.  A couple of
      filesystems had trivial enough ->put_super (only kfree and NULLing of
      s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
      hugetlbfs, omfs, qnx4, shmem, all others got the full treatment.  Most
      of them probably don't need it, but I'd rather sort that out individually.
      Preferably after all the other BKL pushdowns in that area.
      
      [AV: original used to move lock_super() down as well; these changes are
      removed since we don't do lock_super() at all in generic_shutdown_super()
      now]
      [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6cfd0148
    • C
      enforce ->sync_fs is only called for rw superblock · 5af7926f
      Christoph Hellwig 提交于
      Make sure a superblock really is writeable by checking MS_RDONLY
      under s_umount.  sync_filesystems needed some re-arragement for
      that, but all but one sync_filesystem caller had the correct locking
      already so that we could add that check there.  cachefiles grew
      s_umount locking.
      
      I've also added a WARN_ON to sync_filesystem to assert this for
      future callers.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5af7926f
  2. 09 5月, 2009 1 次提交
  3. 01 4月, 2009 1 次提交
    • N
      mm: page_mkwrite change prototype to match fault · c2ec175c
      Nick Piggin 提交于
      Change the page_mkwrite prototype to take a struct vm_fault, and return
      VM_FAULT_xxx flags.  There should be no functional change.
      
      This makes it possible to return much more detailed error information to
      the VM (and also can provide more information eg.  virtual_address to the
      driver, which might be important in some special cases).
      
      This is required for a subsequent fix.  And will also make it easier to
      merge page_mkwrite() with fault() in future.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Artem Bityutskiy <dedekind@infradead.org>
      Cc: Felix Blyakher <felixb@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c2ec175c
  4. 31 3月, 2009 1 次提交
    • A
      UBIFS: fix recovery bug · de097578
      Adrian Hunter 提交于
      UBIFS did not recovery in a situation in which it could
      have. The relevant function assumed there could not be
      more nodes in an eraseblock after a corrupted node, but
      in fact the last (NAND) page written might contain anything.
      The correct approach is to check for empty space (0xFF bytes)
      from then on.
      Signed-off-by: NAdrian Hunter <adrian.hunter@nokia.com>
      de097578
  5. 30 3月, 2009 1 次提交
  6. 28 3月, 2009 1 次提交
  7. 26 3月, 2009 1 次提交
  8. 21 3月, 2009 3 次提交
  9. 16 3月, 2009 3 次提交
    • A
      UBIFS: introduce a helpful variable · fb1cd01a
      Artem Bityutskiy 提交于
      This patch introduces a helpful @c->idx_leb_size variable.
      The patch also fixes some spelling issues and makes comments
      use "LEB" instead of "eraseblock", which is more correct.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      fb1cd01a
    • A
      UBIFS: use KERN_CONT · c9927c3e
      Artem Bityutskiy 提交于
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      c9927c3e
    • A
      UBIFS: fix lprops committing bug · 0a6fb8d9
      Artem Bityutskiy 提交于
      When writing lprop nodes, do not forget to set @from to 0 when
      switching the LEB. This fixes the following bug:
      
      UBIFS error (pid 27768): ubifs_leb_write: writing -15456 bytes at 16:15880, error -22
      UBIFS error (pid 27768): do_commit: commit failed, error -22
      UBIFS warning (pid 27768): ubifs_ro_mode: switched to read-only mode, error -22
      Pid: 27768, comm: freespace Not tainted 2.6.29-rc4-ubifs-2.6 #43
      Call Trace:
       [<ffffffffa00c46d6>] ubifs_ro_mode+0x54/0x56 [ubifs]
       [<ffffffffa00cfa16>] do_commit+0x4f5/0x50a [ubifs]
       [<ffffffffa00cfae7>] ubifs_run_commit+0xbc/0xdb [ubifs]
       [<ffffffffa00d42b9>] ubifs_budget_space+0x742/0x9ed [ubifs]
       [<ffffffff812daf45>] ? __mutex_lock_common+0x361/0x3ae
       [<ffffffffa00bc437>] ? ubifs_write_begin+0x18d/0x44c [ubifs]
       [<ffffffffa00bc5cb>] ubifs_write_begin+0x321/0x44c [ubifs]
       [<ffffffff8106222b>] ? trace_hardirqs_on_caller+0x1f/0x14d
       [<ffffffff81097ce2>] generic_file_buffered_write+0x12f/0x2d9
       [<ffffffff8109828d>] __generic_file_aio_write_nolock+0x261/0x295
       [<ffffffff81098aff>] generic_file_aio_write+0x69/0xc5
       [<ffffffffa00bb914>] ubifs_aio_write+0x14c/0x19e [ubifs]
       [<ffffffff810c8f42>] do_sync_write+0xe7/0x12d
       [<ffffffff81055378>] ? autoremove_wake_function+0x0/0x38
       [<ffffffff81149edc>] ? security_file_permission+0x11/0x13
       [<ffffffff810c9827>] vfs_write+0xab/0x105
       [<ffffffff810c9945>] sys_write+0x47/0x6f
       [<ffffffff8100c35b>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0a6fb8d9
  10. 15 3月, 2009 1 次提交
  11. 14 3月, 2009 1 次提交
    • A
      UBIFS: fix bug where page is marked uptodate when out of space · f55aa591
      Adrian Hunter 提交于
      UBIFS fast path in write_begin may mark a page up to date
      and then discover that there may not be enough space to do
      the write, and so fall back to a slow path.  The slow path
      tries harder, but may still find no space - leaving the page
      marked up to date, when it is not.  This patch ensures that
      the page is marked not up to date in that case.
      
      The bug that this patch fixes becomes evident when the write
      is into a hole (sparse file) or is at the end of the file
      and a subsequent read is off the end of the file.  In both
      cases, the file system should return zeros but was instead
      returning the page that had not been written because the
      file system was out of space.
      Signed-off-by: NAdrian Hunter <ext-adrian.hunter@nokia.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f55aa591
  12. 08 3月, 2009 2 次提交
  13. 17 2月, 2009 1 次提交
  14. 09 2月, 2009 1 次提交
  15. 29 1月, 2009 5 次提交
  16. 28 1月, 2009 1 次提交
  17. 27 1月, 2009 2 次提交
    • A
      UBIFS: fix no_chk_data_crc · 6f7ab6d4
      Artem Bityutskiy 提交于
      When data CRC checking is disabled, UBIFS returns incorrect return
      code from the 'try_read_node()' function (0 instead of 1, which means
      CRC error), which make the caller re-read the data node again, but using
      a different code patch, so the second read is fine. Thus, we read the
      same node twice. And the result of this is that UBIFS is slower
      with no_chk_data_crc option than it is with chk_data_crc option.
      This patches fixes the problem.
      Reported-by: NReuben Dowle <Reuben.Dowle@navico.com>
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6f7ab6d4
    • A
      UBIFS: fix assertions · 6ba87c9b
      Artem Bityutskiy 提交于
      I introduce wrong assertions in one of the previous commits, this
      patch fixes them.
      
      Also, initialize debugfs after the debugging check. This is a little
      nicer because we want the FS data to be accessible to external users
      after everything has been initialized.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6ba87c9b
  18. 26 1月, 2009 5 次提交
  19. 20 1月, 2009 2 次提交
  20. 18 1月, 2009 2 次提交
  21. 07 1月, 2009 1 次提交
  22. 06 1月, 2009 1 次提交
  23. 05 1月, 2009 1 次提交
    • N
      fs: symlink write_begin allocation context fix · 54566b2c
      Nick Piggin 提交于
      With the write_begin/write_end aops, page_symlink was broken because it
      could no longer pass a GFP_NOFS type mask into the point where the
      allocations happened.  They are done in write_begin, which would always
      assume that the filesystem can be entered from reclaim.  This bug could
      cause filesystem deadlocks.
      
      The funny thing with having a gfp_t mask there is that it doesn't really
      allow the caller to arbitrarily tinker with the context in which it can be
      called.  It couldn't ever be GFP_ATOMIC, for example, because it needs to
      take the page lock.  The only thing any callers care about is __GFP_FS
      anyway, so turn that into a single flag.
      
      Add a new flag for write_begin, AOP_FLAG_NOFS.  Filesystems can now act on
      this flag in their write_begin function.  Change __grab_cache_page to
      accept a nofs argument as well, to honour that flag (while we're there,
      change the name to grab_cache_page_write_begin which is more instructive
      and does away with random leading underscores).
      
      This is really a more flexible way to go in the end anyway -- if a
      filesystem happens to want any extra allocations aside from the pagecache
      ones in ints write_begin function, it may now use GFP_KERNEL (rather than
      GFP_NOFS) for common case allocations (eg.  ocfs2_alloc_write_ctxt, for a
      random example).
      
      [kosaki.motohiro@jp.fujitsu.com: fix ubifs]
      [kosaki.motohiro@jp.fujitsu.com: fix fuse]
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.28.x]
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      [ Cleaned up the calling convention: just pass in the AOP flags
        untouched to the grab_cache_page_write_begin() function.  That
        just simplifies everybody, and may even allow future expansion of the
        logic.   - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      54566b2c