1. 01 Aug, 2017 1 commit
    • Jeff Layton's avatar
      fs: convert a pile of fsync routines to errseq_t based reporting · 3b49c9a1
      Jeff Layton authored
      This patch converts most of the in-kernel filesystems that do writeback
      out of the pagecache to report errors using the errseq_t-based
      infrastructure that was recently added. This allows them to report
      errors once for each open file description.
      Most filesystems have a fairly straightforward fsync operation. They
      call filemap_write_and_wait_range to write back all of the data and
      wait on it, and then (sometimes) sync out the metadata.
      For those filesystems this is a straightforward conversion from calling
      filemap_write_and_wait_range in their fsync operation to calling
      Acked-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
  2. 09 May, 2016 1 commit
  3. 22 Jan, 2016 1 commit
    • Al Viro's avatar
      wrappers for ->i_mutex access · 5955102c
      Al Viro authored
      only shared.
  4. 15 Apr, 2015 1 commit
  5. 08 Aug, 2014 1 commit
  6. 06 May, 2014 5 commits
  7. 02 Apr, 2014 1 commit
    • Jeff Mahoney's avatar
      reiserfs: fix race in readdir · 01d88857
      Jeff Mahoney authored
      The -ENOENT is due to readdir calling dir_emit on the same entry twice.
      If the dir_emit callback sleeps and the tree is changed underneath us,
      we won't be able to trust deh_offset(deh) anymore. We need to save
      next_pos before we might sleep so we can find the next entry.
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
  8. 08 Aug, 2013 1 commit
    • Jeff Mahoney's avatar
      reiserfs: locking, handle nested locks properly · 278f6679
      Jeff Mahoney authored
      The reiserfs write lock replaced the BKL and uses similar semantics.
      Frederic's locking code makes a distinction between when the lock is nested
      and when it's being acquired/released, but I don't think that's the right
      distinction to make.
      The right distinction is between the lock being released at end-of-use and
      the lock being released for a schedule. The unlock should return the depth
      and the lock should restore it, rather than the other way around as it is now.
      This patch implements that and adds a number of places where the lock
      should be dropped.
  9. 29 Jun, 2013 3 commits
  10. 31 May, 2013 1 commit
    • Jeff Mahoney's avatar
      reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry · 0bdc7acb
      Jeff Mahoney authored
      changed and research. The next_pos pointer is updated but its value
      xattr code where it can manifest with the following warning:
      reiserfs_for_each_xattr uses reiserfs_readdir_dentry to iterate over
      point I'll need to add support into reiserfsck to remove the orphaned
      directories left behind when this occurs.
  11. 21 Mar, 2012 1 commit
  12. 21 Jul, 2011 1 commit
    • Josef Bacik's avatar
      fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers · 02c24a82
      Josef Bacik authored
      Btrfs needs to be able to control how filemap_write_and_wait_range() is called
      in fsync to make it less of a painful operation, so push down taking i_mutex and
      the calling of filemap_write_and_wait() down into the ->fsync() handlers.  Some
      file systems can drop taking the i_mutex altogether it seems, like ext3 and
      ocfs2.  For correctness sake I just pushed everything down in all cases to make
      sure that we keep the current behavior the same for everybody, and then each
      individual fs maintainer can make up their mind about what to do from there.
      Acked-by: default avatarJan Kara <jack@suse.cz>
  13. 28 May, 2010 1 commit
  14. 27 May, 2010 1 commit
    • jan Blunck's avatar
      fs/: do not fallback to default_llseek() when readdir() uses BKL · ca572727
      jan Blunck authored
      Do not use the fallback default_llseek() if the readdir operation of the
      filesystem still uses the big kernel lock.
      Since llseek() modifies
      file->f_pos of the directory directly it may need locking to not confuse
      readdir which usually uses file->f_pos directly as well
      Since the special characteristics of the BKL (unlocked on schedule) are
      not necessary in this case, the inode mutex can be used for locking as
      provided by generic_file_llseek().  This is only possible since all
      filesystems, except reiserfs, either use a directory as a flat file or
      with disk address offsets.  Reiserfs on the other hand uses a 32bit hash
      off the filename as the offset so generic_file_llseek() can get used as
      well since the hash is always smaller than sb->s_maxbytes (= (512 << 32) -
      Signed-off-by: default avatarJan Blunck <jblunck@suse.de>
      Acked-by: default avatarJan Kara <jack@suse.cz>
      Acked-by: Anders Larsen's avatarAnders Larsen <al@alarsen.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
  15. 24 Apr, 2010 1 commit
  16. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      Tejun Heo authored
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      used as the basis of conversion.
      The script does the followings.
        gfp.h, if slab is used, slab.h.
        to its surrounding.  It's put in the include block which contains
        doesn't seem to be any matching order.
      The conversion was done in the following steps.
         some needed manual addition while adding it to implementation .h or
         inclusions to around 150 files.
         from #2 to make sure no file was left behind.
         APIs requiring slab.h to be added manually.
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         distributed build env didn't work with gcov compiles) and a few
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
         a separate patch and serve as bisection point.
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  17. 14 Oct, 2009 1 commit
    • Frederic Weisbecker's avatar
      kill-the-bkl/reiserfs: definitely drop the bkl from reiserfs_ioctl() · 205cb37b
      Frederic Weisbecker authored
      The reiserfs ioctl path doesn't need the big kernel lock anymore , now
      that the filesystem synchronizes through its own lock.
      We can then turn reiserfs_ioctl() into an unlocked_ioctl callback.
      Cc: Jeff Mahoney <jeffm@suse.com>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Alexander Beregalov <a.beregalov@gmail.com>
      Cc: Laurent Riffard <laurent.riffard@free.fr>
      Cc: Thomas Gleixner <tglx@linutronix.de>
  18. 14 Sep, 2009 1 commit
    • Frederic Weisbecker's avatar
      reiserfs: kill-the-BKL · 8ebc4232
      Frederic Weisbecker authored
      This patch is an attempt to remove the Bkl based locking scheme from
      reiserfs and is intended.
      It is a bit inspired from an old attempt by Peter Zijlstra:
      The bkl is heavily used in this filesystem to prevent from
      concurrent write accesses on the filesystem.
      Reiserfs makes a deep use of the specific properties of the Bkl:
      - It can be acqquired recursively by a same task
      - It is released on the schedule() calls and reacquired when schedule() returns
      The two properties above are a roadmap for the reiserfs write locking so it's
      very hard to simply replace it with a common mutex.
      - We need a recursive-able locking unless we want to restructure several blocks
        of the code.
      - We need to identify the sites where the bkl was implictly relaxed
        (schedule, wait, sync, etc...) so that we can in turn release and
        reacquire our new lock explicitly.
        Such implicit releases of the lock are often required to let other
        resources producer/consumer do their job or we can suffer unexpected
        starvations or deadlocks.
      So the new lock that replaces the bkl here is a per superblock mutex with a
      specific property: it can be acquired recursively by a same task, like the
      For such purpose, we integrate a lock owner and a lock depth field on the
      superblock information structure.
      The first axis on this patch is to turn reiserfs_write_(un)lock() function
      into a wrapper to manage this mutex. Also some explicit calls to
      lock_kernel() have been converted to reiserfs_write_lock() helpers.
      The second axis is to find the important blocking sites (schedule...(),
      wait_on_buffer(), sync_dirty_buffer(), etc...) and then apply an explicit
      release of the write lock on these locations before blocking. Then we can
      safely wait for those who can give us resources or those who need some.
      Typically this is a fight between the current writer, the reiserfs workqueue
      (aka the async commiter) and the pdflush threads.
      The third axis is a consequence of the second. The write lock is usually
      on top of a lock dependency chain which can include the journal lock, the
      flush lock or the commit lock. So it's dangerous to release and trying to
      reacquire the write lock while we still hold other locks.
      This is fine with the bkl:
            T1                       T2
          // do something
                                      mutex_lock(A) -> already locked by T1
                                      schedule() (and then unlock_kernel())
      This is not fine with a mutex:
            T1                       T2
          // do something
                                    mutex_lock(A) -> already locked by T1
          mutex_lock(write) -> already locked by T2
      The solution in this patch is to provide a helper which releases the write
      lock and sleep a bit if we can't lock a mutex that depend on it. It's another
      simulation of the bkl behaviour.
      The last axis is to locate the fs callbacks that are called with the bkl held,
      according to Documentation/filesystem/Locking.
      Those are:
      - reiserfs_remount
      - reiserfs_fill_super
      - reiserfs_put_super
      Reiserfs didn't need to explicitly lock because of the context of these callbacks.
      But now we must take care of that with the new locking.
      After this patch, reiserfs suffers from a slight performance regression (for now).
      On UP, a high volume write with dd reports an average of 27 MB/s instead
      of 30 MB/s without the patch applied.
      Reviewed-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Jeff Mahoney <jeffm@suse.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Bron Gondwana <brong@fastmail.fm>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      LKML-Reference: <1239070789-13354-1-git-send-email-fweisbec@gmail.com>
  19. 12 Jun, 2009 1 commit
  20. 09 May, 2009 1 commit
  21. 30 Mar, 2009 1 commit
    • Jeff Mahoney's avatar
      reiserfs: use generic readdir for operations across all xattrs · a41f1a47
      Jeff Mahoney authored
      The current reiserfs xattr implementation open codes reiserfs_readdir
      and frees the path before calling the filldir function.  Typically, the
      filldir function is something that modifies the file system, such as a
      chown or an inode deletion that also require reading of an inode
      associated with each direntry.  Since the file system is modified, the
      path retained becomes invalid for the next run.  In addition, it runs
      backwards in attempt to minimize activity.
      This is clearly suboptimal from a code cleanliness perspective as well
      as performance-wise.
      This patch implements a generic reiserfs_for_each_xattr that uses the
      generic readdir and a specific filldir routine that simply populates an
      array of dentries and then performs a specific operation on them.  When
      all files have been operated on, it then calls the operation on the
      directory itself.
      The result is a noticable code reduction and better performance.
  22. 17 Oct, 2007 1 commit
  23. 24 May, 2007 1 commit
  24. 08 May, 2007 1 commit
  25. 08 Dec, 2006 1 commit
  26. 30 Sep, 2006 1 commit
  27. 30 Jun, 2006 1 commit
  28. 28 Mar, 2006 1 commit
  29. 01 Feb, 2006 1 commit
  30. 13 Jul, 2005 1 commit
    • Linus Torvalds's avatar
      reiserfs: run scripts/Lindent on reiserfs code · bd4c625c
      Linus Torvalds authored
      This was a pure indentation change, using:
      	scripts/Lindent fs/reiserfs/*.c include/linux/reiserfs_*.h
      to make reiserfs match the regular Linux indentation style.  As Jeff
      Mahoney <jeffm@suse.com> writes:
       The ReiserFS code is a mix of a number of different coding styles, sometimes
       different even from line-to-line. Since the code has been relatively stable
       for quite some time and there are few outstanding patches to be applied, it
       is time to reformat the code to conform to the Linux style standard outlined
       in Documentation/CodingStyle.
       This patch contains the result of running scripts/Lindent against
       fs/reiserfs/*.c and include/linux/reiserfs_*.h. There are places where the
       code can be made to look better, but I'd rather keep those patches separate
       so that there isn't a subtle by-hand hand accident in the middle of a huge
       patch. To be clear: This patch is reformatting *only*.
       A number of patches may follow that continue to make the code more consistent
       with the Linux coding style.
       Hans wasn't particularly enthusiastic about these patches, but said he
       wouldn't really oppose them either.
  31. 01 May, 2005 1 commit
  32. 16 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      infrastructure for it.
      Let it rip!