1. 27 9月, 2017 2 次提交
    • J
      quota: Fix quota corruption with generic/232 test · 4c6bb696
      Jan Kara 提交于
      Eric has reported that since commit d2faa415 "quota: Do not acquire
      dqio_sem for dquot overwrites in v2 format" test generic/232
      occasionally fails due to quota information being incorrect. Indeed that
      commit was too eager to remove dqio_sem completely from the path that
      just overwrites quota structure with updated information. Although that
      is innocent on its own, another process that inserts new quota structure
      to the same block can perform read-modify-write cycle of that block thus
      effectively discarding quota information update if they race in a wrong
      way.
      
      Fix the problem by acquiring dqio_sem for reading for overwrites of
      quota structure. Note that it *is* possible to completely avoid taking
      dqio_sem in the overwrite path however that will require modifying path
      inserting / deleting quota structures to avoid RMW cycles of the full
      block and for now it is not clear whether it is worth the hassle.
      
      Fixes: d2faa415Reported-and-tested-by: NEric Whitney <enwlinux@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4c6bb696
    • A
      vfs: Return -ENXIO for negative SEEK_HOLE / SEEK_DATA offsets · fc46820b
      Andreas Gruenbacher 提交于
      In generic_file_llseek_size, return -ENXIO for negative offsets as well
      as offsets beyond EOF.  This affects filesystems which don't implement
      SEEK_HOLE / SEEK_DATA internally, possibly because they don't support
      holes.
      
      Fixes xfstest generic/448.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fc46820b
  2. 26 9月, 2017 1 次提交
  3. 25 9月, 2017 1 次提交
    • L
      fs: Fix page cache inconsistency when mixing buffered and AIO DIO · 332391a9
      Lukas Czerner 提交于
      Currently when mixing buffered reads and asynchronous direct writes it
      is possible to end up with the situation where we have stale data in the
      page cache while the new data is already written to disk. This is
      permanent until the affected pages are flushed away. Despite the fact
      that mixing buffered and direct IO is ill-advised it does pose a thread
      for a data integrity, is unexpected and should be fixed.
      
      Fix this by deferring completion of asynchronous direct writes to a
      process context in the case that there are mapped pages to be found in
      the inode. Later before the completion in dio_complete() invalidate
      the pages in question. This ensures that after the completion the pages
      in the written area are either unmapped, or populated with up-to-date
      data. Also do the same for the iomap case which uses
      iomap_dio_complete() instead.
      
      This has a side effect of deferring the completion to a process context
      for every AIO DIO that happens on inode that has pages mapped. However
      since the consensus is that this is ill-advised practice the performance
      implication should not be a problem.
      
      This was based on proposal from Jeff Moyer, thanks!
      Reviewed-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      332391a9
  4. 23 9月, 2017 2 次提交
  5. 21 9月, 2017 5 次提交
  6. 20 9月, 2017 5 次提交
  7. 19 9月, 2017 1 次提交
  8. 18 9月, 2017 5 次提交
  9. 16 9月, 2017 1 次提交
    • J
      fs/proc: Report eip/esp in /prod/PID/stat for coredumping · fd7d5627
      John Ogness 提交于
      Commit 0a1eb2d4 ("fs/proc: Stop reporting eip and esp in
      /proc/PID/stat") stopped reporting eip/esp because it is
      racy and dangerous for executing tasks. The comment adds:
      
          As far as I know, there are no use programs that make any
          material use of these fields, so just get rid of them.
      
      However, existing userspace core-dump-handler applications (for
      example, minicoredumper) are using these fields since they
      provide an excellent cross-platform interface to these valuable
      pointers. So that commit introduced a user space visible
      regression.
      
      Partially revert the change and make the readout possible for
      tasks with the proper permissions and only if the target task
      has the PF_DUMPCORE flag set.
      
      Fixes: 0a1eb2d4 ("fs/proc: Stop reporting eip and esp in> /proc/PID/stat")
      Reported-by: NMarco Felsch <marco.felsch@preh.de>
      Signed-off-by: NJohn Ogness <john.ogness@linutronix.de>
      Reviewed-by: NAndy Lutomirski <luto@kernel.org>
      Cc: Tycho Andersen <tycho.andersen@canonical.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: stable@vger.kernel.org
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Linux API <linux-api@vger.kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/87poatfwg6.fsf@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      fd7d5627
  10. 15 9月, 2017 9 次提交
  11. 14 9月, 2017 3 次提交
    • M
      mm: treewide: remove GFP_TEMPORARY allocation flag · 0ee931c4
      Michal Hocko 提交于
      GFP_TEMPORARY was introduced by commit e12ba74d ("Group short-lived
      and reclaimable kernel allocations") along with __GFP_RECLAIMABLE.  It's
      primary motivation was to allow users to tell that an allocation is
      short lived and so the allocator can try to place such allocations close
      together and prevent long term fragmentation.  As much as this sounds
      like a reasonable semantic it becomes much less clear when to use the
      highlevel GFP_TEMPORARY allocation flag.  How long is temporary? Can the
      context holding that memory sleep? Can it take locks? It seems there is
      no good answer for those questions.
      
      The current implementation of GFP_TEMPORARY is basically GFP_KERNEL |
      __GFP_RECLAIMABLE which in itself is tricky because basically none of
      the existing caller provide a way to reclaim the allocated memory.  So
      this is rather misleading and hard to evaluate for any benefits.
      
      I have checked some random users and none of them has added the flag
      with a specific justification.  I suspect most of them just copied from
      other existing users and others just thought it might be a good idea to
      use without any measuring.  This suggests that GFP_TEMPORARY just
      motivates for cargo cult usage without any reasoning.
      
      I believe that our gfp flags are quite complex already and especially
      those with highlevel semantic should be clearly defined to prevent from
      confusion and abuse.  Therefore I propose dropping GFP_TEMPORARY and
      replace all existing users to simply use GFP_KERNEL.  Please note that
      SLAB users with shrinkers will still get __GFP_RECLAIMABLE heuristic and
      so they will be placed properly for memory fragmentation prevention.
      
      I can see reasons we might want some gfp flag to reflect shorterm
      allocations but I propose starting from a clear semantic definition and
      only then add users with proper justification.
      
      This was been brought up before LSF this year by Matthew [1] and it
      turned out that GFP_TEMPORARY really doesn't have a clear semantic.  It
      seems to be a heuristic without any measured advantage for most (if not
      all) its current users.  The follow up discussion has revealed that
      opinions on what might be temporary allocation differ a lot between
      developers.  So rather than trying to tweak existing users into a
      semantic which they haven't expected I propose to simply remove the flag
      and start from scratch if we really need a semantic for short term
      allocations.
      
      [1] http://lkml.kernel.org/r/20170118054945.GD18349@bombadil.infradead.org
      
      [akpm@linux-foundation.org: fix typo]
      [akpm@linux-foundation.org: coding-style fixes]
      [sfr@canb.auug.org.au: drm/i915: fix up]
        Link: http://lkml.kernel.org/r/20170816144703.378d4f4d@canb.auug.org.au
      Link: http://lkml.kernel.org/r/20170728091904.14627-1-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0ee931c4
    • A
      fscache: fix fscache_objlist_show format processing · ebfddb3d
      Arnd Bergmann 提交于
      gcc points out a minor bug in the handling of unknown cookie types,
      which could result in a string overflow when the integer is copied into
      a 3-byte string:
      
        fs/fscache/object-list.c: In function 'fscache_objlist_show':
        fs/fscache/object-list.c:265:19: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
         sprintf(_type, "%02u", cookie->def->type);
                        ^~~~~~
        fs/fscache/object-list.c:265:4: note: 'sprintf' output between 3 and 4 bytes into a destination of size 3
      
      This is currently harmless as no code sets a type other than 0 or 1, but
      it makes sense to use snprintf() here to avoid overflowing the array if
      that changes.
      
      Link: http://lkml.kernel.org/r/20170714120720.906842-22-arnd@arndb.deSigned-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ebfddb3d
    • A
      procfs: remove unused variable · 6dec0dd4
      Arnd Bergmann 提交于
      In NOMMU configurations, we get a warning about a variable that has become
      unused:
      
        fs/proc/task_nommu.c: In function 'nommu_vma_show':
        fs/proc/task_nommu.c:148:28: error: unused variable 'priv' [-Werror=unused-variable]
      
      Link: http://lkml.kernel.org/r/20170911200231.3171415-1-arnd@arndb.de
      Fixes: 1240ea0d ("fs, proc: remove priv argument from is_stack")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6dec0dd4
  12. 13 9月, 2017 5 次提交