1. 31 Oct, 2017 3 commits
    • Andreas Gruenbacher's avatar
      gfs2: Fix and clean up {GET,SET}FLAGS ioctl · b16f7e57
      Andreas Gruenbacher authored
      Switch to a simple array for mapping between the FS_*_FL and GFS_DIF_*
      flags.  Clarify how the mapping between FS_JOURNAL_DATA_FL and the
      filesystem flags works.  The GFS2_DIF_SYSTEM flag cannot be set from
      user space, so remove it from GFS2_FLAGS_USER_SET.  Fail with -EINVAL
      when trying to set flags that are not supported instead of silently
      ignoring those flags.
      
      Partially fixes xfstest generic/424.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Reviewed-by: Andrew Price's avatarAndrew Price <anprice@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      b16f7e57
    • Bob Peterson's avatar
      GFS2: Take inode off order_write list when setting jdata flag · cc555b09
      Bob Peterson authored
      This patch fixes a deadlock caused when the jdata flag is set for
      inodes that are already on the ordered write list. Since it is
      on the ordered write list, log_flush calls gfs2_ordered_write which
      calls filemap_fdatawrite. But since the inode had the jdata flag
      set, that calls gfs2_jdata_writepages, which tries to start a new
      transaction. A new transaction cannot be started because it tries
      to acquire the log_flush rwsem which is already locked by the log
      flush operation.
      
      The bottom line is: We cannot switch an inode from ordered to jdata
      until we eliminate any ordered data pages (via log flush) or any
      log_flush operation afterward will create the circular dependency
      above. So we need to flush the log before setting the diskflags to
      switch the file mode, then we need to remove the inode from the
      ordered writes list.
      
      Before this patch, the log flush was done for jdata->ordered, but
      that's wrong. If we're going from jdata to ordered, we don't need
      to call gfs2_log_flush because the call to filemap_fdatawrite will
      do it for us:
      
         filemap_fdatawrite() -> __filemap_fdatawrite_range()
            __filemap_fdatawrite_range() -> do_writepages()
               do_writepages() -> gfs2_jdata_writepages()
                  gfs2_jdata_writepages() -> gfs2_log_flush()
      
      This patch modifies function do_gfs2_set_flags so that if a file
      has its jdata flag set, and it's already on the ordered write list,
      the log will be flushed and it will be removed from the list
      before setting the flag.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Acked-by: default avatarAbhijith Das <adas@redhat.com>
      cc555b09
    • Andreas Gruenbacher's avatar
      gfs2: Implement SEEK_HOLE / SEEK_DATA via iomap · 3a27411c
      Andreas Gruenbacher authored
      So far, lseek on gfs2 did not report holes.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      3a27411c
  2. 25 Sep, 2017 1 commit
  3. 01 Aug, 2017 1 commit
  4. 17 Jul, 2017 1 commit
  5. 05 Apr, 2017 1 commit
  6. 25 Feb, 2017 1 commit
  7. 24 Dec, 2016 1 commit
  8. 05 Oct, 2016 1 commit
  9. 26 Sep, 2016 1 commit
  10. 27 Jun, 2016 1 commit
    • Andreas Gruenbacher's avatar
      gfs2: Lock holder cleanup · 6df9f9a2
      Andreas Gruenbacher authored
      Make the code more readable by cleaning up the different ways of
      initializing lock holders and checking for initialized lock holders:
      mark lock holders as uninitialized by setting the holder's glock to NULL
      (gfs2_holder_mark_uninitialized) instead of zeroing out the entire
      object or using a separate flag.  Recognize initialized holders by their
      non-NULL glock (gfs2_holder_initialized).  Don't zero out holder objects
      which are immeditiately initialized via gfs2_holder_init or
      gfs2_glock_nq_init.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      6df9f9a2
  11. 12 May, 2016 1 commit
  12. 02 May, 2016 1 commit
  13. 01 May, 2016 1 commit
  14. 19 Apr, 2016 1 commit
  15. 05 Apr, 2016 1 commit
  16. 04 Apr, 2016 1 commit
    • Kirill A. Shutemov's avatar
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov authored
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  17. 22 Jan, 2016 1 commit
    • Al Viro's avatar
      wrappers for ->i_mutex access · 5955102c
      Al Viro authored
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  18. 22 Dec, 2015 1 commit
  19. 14 Dec, 2015 2 commits
    • Bob Peterson's avatar
      GFS2: Reduce size of incore inode · b58bf407
      Bob Peterson authored
      This patch makes no functional changes. Its goal is to reduce the
      size of the gfs2 inode in memory by rearranging structures and
      changing the size of some variables within the structure.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      b58bf407
    • Bob Peterson's avatar
      GFS2: Make rgrp reservations part of the gfs2_inode structure · a097dc7e
      Bob Peterson authored
      Before this patch, multi-block reservation structures were allocated
      from a special slab. This patch folds the structure into the gfs2_inode
      structure. The disadvantage is that the gfs2_inode needs more memory,
      even when a file is opened read-only. The advantages are: (a) we don't
      need the special slab and the extra time it takes to allocate and
      deallocate from it. (b) we no longer need to worry that the structure
      exists for things like quota management. (c) This also allows us to
      remove the calls to get_write_access and put_write_access since we
      know the structure will exist.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      a097dc7e
  20. 24 Nov, 2015 1 commit
    • Bob Peterson's avatar
      GFS2: Extract quota data from reservations structure (revert 5407e242) · b54e9a0b
      Bob Peterson authored
      This patch basically reverts the majority of patch 5407e242.
      That patch eliminated the gfs2_qadata structure in favor of just
      using the reservations structure. The problem with doing that is that
      it increases the size of the reservations structure. That is not an
      issue until it comes time to fold the reservations structure into the
      inode in memory so we know it's always there. By separating out the
      quota structure again, we aren't punishing the non-quota users by
      making all the inodes bigger, requiring more slab space. This patch
      creates a new slab area to allocate the quota stuff so it's managed
      a little more sanely.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      b54e9a0b
  21. 10 Nov, 2015 1 commit
  22. 22 Oct, 2015 1 commit
  23. 22 Sep, 2015 1 commit
  24. 09 Jun, 2015 1 commit
  25. 05 May, 2015 1 commit
  26. 12 Apr, 2015 2 commits
  27. 26 Mar, 2015 1 commit
  28. 18 Mar, 2015 4 commits
  29. 10 Feb, 2015 1 commit
  30. 05 Feb, 2015 1 commit
    • Theodore Ts'o's avatar
      vfs: add support for a lazytime mount option · 0ae45f63
      Theodore Ts'o authored
      Add a new mount option which enables a new "lazytime" mode.  This mode
      causes atime, mtime, and ctime updates to only be made to the
      in-memory version of the inode.  The on-disk times will only get
      updated when (a) if the inode needs to be updated for some non-time
      related change, (b) if userspace calls fsync(), syncfs() or sync(), or
      (c) just before an undeleted inode is evicted from memory.
      
      This is OK according to POSIX because there are no guarantees after a
      crash unless userspace explicitly requests via a fsync(2) call.
      
      For workloads which feature a large number of random write to a
      preallocated file, the lazytime mount option significantly reduces
      writes to the inode table.  The repeated 4k writes to a single block
      will result in undesirable stress on flash devices and SMR disk
      drives.  Even on conventional HDD's, the repeated writes to the inode
      table block will trigger Adjacent Track Interference (ATI) remediation
      latencies, which very negatively impact long tail latencies --- which
      is a very big deal for web serving tiers (for example).
      
      Google-Bug-Id: 18297052
      Signed-off-by: Theodore Ts'o's avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      0ae45f63
  31. 14 Nov, 2014 3 commits