1. 09 11月, 2015 1 次提交
  2. 05 11月, 2015 1 次提交
  3. 30 10月, 2015 1 次提交
  4. 23 10月, 2015 1 次提交
  5. 02 10月, 2015 1 次提交
    • B
      gfs2: Add missing else in trans_add_meta/data · 491e94f7
      Bob Peterson 提交于
      This patch fixes a timing window that causes a segfault.
      The problem is that bd can remain NULL throughout the function
      and then reference that NULL pointer if the bh->b_private starts
      out NULL, then someone sets it to non-NULL inside the locking.
      In that case, bd still needs to be set.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      491e94f7
  6. 23 9月, 2015 1 次提交
    • A
      GFS2: Set s_mode before parsing mount options · 6de20eb0
      Andrew Price 提交于
      In the generic mount_bdev() function, deactivate_locked_super() is
      called after the fill_super() call fails, at which point s_mode has been
      set. kill_block_super() expects this and dumps a warning when
      FMODE_EXCL is not set in s_mode.
      
      In gfs2_mount() we call deactivate_locked_super() on failure of
      gfs2_mount_args(), at which point s_mode has not yet been set. This
      causes kill_block_super() to dump a stack trace when gfs2 fails to mount
      with invalid options. Set s_mode earlier in gfs2_mount() to avoid that.
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      6de20eb0
  7. 22 9月, 2015 1 次提交
  8. 05 9月, 2015 1 次提交
    • K
      fs: create and use seq_show_option for escaping · a068acf2
      Kees Cook 提交于
      Many file systems that implement the show_options hook fail to correctly
      escape their output which could lead to unescaped characters (e.g.  new
      lines) leaking into /proc/mounts and /proc/[pid]/mountinfo files.  This
      could lead to confusion, spoofed entries (resulting in things like
      systemd issuing false d-bus "mount" notifications), and who knows what
      else.  This looks like it would only be the root user stepping on
      themselves, but it's possible weird things could happen in containers or
      in other situations with delegated mount privileges.
      
      Here's an example using overlay with setuid fusermount trusting the
      contents of /proc/mounts (via the /etc/mtab symlink).  Imagine the use
      of "sudo" is something more sneaky:
      
        $ BASE="ovl"
        $ MNT="$BASE/mnt"
        $ LOW="$BASE/lower"
        $ UP="$BASE/upper"
        $ WORK="$BASE/work/ 0 0
        none /proc fuse.pwn user_id=1000"
        $ mkdir -p "$LOW" "$UP" "$WORK"
        $ sudo mount -t overlay -o "lowerdir=$LOW,upperdir=$UP,workdir=$WORK" none /mnt
        $ cat /proc/mounts
        none /root/ovl/mnt overlay rw,relatime,lowerdir=ovl/lower,upperdir=ovl/upper,workdir=ovl/work/ 0 0
        none /proc fuse.pwn user_id=1000 0 0
        $ fusermount -u /proc
        $ cat /proc/mounts
        cat: /proc/mounts: No such file or directory
      
      This fixes the problem by adding new seq_show_option and
      seq_show_option_n helpers, and updating the vulnerable show_option
      handlers to use them as needed.  Some, like SELinux, need to be open
      coded due to unusual existing escape mechanisms.
      
      [akpm@linux-foundation.org: add lost chunk, per Kees]
      [keescook@chromium.org: seq_show_option should be using const parameters]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Acked-by: NJan Kara <jack@suse.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Cc: J. R. Okajima <hooanon05g@gmail.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a068acf2
  9. 04 9月, 2015 6 次提交
  10. 14 8月, 2015 1 次提交
  11. 29 7月, 2015 1 次提交
    • C
      block: add a bi_error field to struct bio · 4246a0b6
      Christoph Hellwig 提交于
      Currently we have two different ways to signal an I/O error on a BIO:
      
       (1) by clearing the BIO_UPTODATE flag
       (2) by returning a Linux errno value to the bi_end_io callback
      
      The first one has the drawback of only communicating a single possible
      error (-EIO), and the second one has the drawback of not beeing persistent
      when bios are queued up, and are not passed along from child to parent
      bio in the ever more popular chaining scenario.  Having both mechanisms
      available has the additional drawback of utterly confusing driver authors
      and introducing bugs where various I/O submitters only deal with one of
      them, and the others have to add boilerplate code to deal with both kinds
      of error returns.
      
      So add a new bi_error field to store an errno value directly in struct
      bio and remove the existing mechanisms to clean all this up.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      4246a0b6
  12. 19 6月, 2015 2 次提交
    • B
      GFS2: Don't brelse rgrp buffer_heads every allocation · 39b0f1e9
      Bob Peterson 提交于
      This patch allows the block allocation code to retain the buffers
      for the resource groups so they don't need to be re-read from buffer
      cache with every request. This is a performance improvement that's
      especially noticeable when resource groups are very large. For
      example, with 2GB resource groups and 4K blocks, there can be 33
      blocks for every resource group. This patch allows those 33 buffers
      to be kept around and not read in and thrown away with every
      operation. The buffers are released when the resource group is
      either synced or invalidated.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Reviewed-by: NSteven Whitehouse <swhiteho@redhat.com>
      Reviewed-by: NBenjamin Marzinski <bmarzins@redhat.com>
      39b0f1e9
    • B
      GFS2: Don't add all glocks to the lru · e7ccaf5f
      Bob Peterson 提交于
      The glocks used for resource groups often come and go hundreds of
      thousands of times per second. Adding them to the lru list just
      adds unnecessary contention for the lru_lock spin_lock, especially
      considering we're almost certainly going to re-use the glock and
      take it back off the lru microseconds later. We never want the
      glock shrinker to cull them anyway. This patch adds a new bit in
      the glops that determines which glock types get put onto the lru
      list and which ones don't.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Acked-by: NSteven Whitehouse <swhiteho@redhat.com>
      e7ccaf5f
  13. 09 6月, 2015 2 次提交
  14. 03 6月, 2015 2 次提交
    • A
      gfs2: limit quota log messages · 9cde2898
      Abhi Das 提交于
      This patch makes the quota subsystem only report once that a
      particular user/group has exceeded their allotted quota.
      
      Previously, it was possible for a program to continuously try
      exceeding quota (despite receiving EDQUOT) and in turn trigger
      gfs2 to issue a kernel log message about quota exceed. In theory,
      this could get out of hand and flood the log and the filesystem
      hosting the log files.
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      9cde2898
    • A
      gfs2: fix quota updates on block boundaries · 39a72580
      Abhi Das 提交于
      For smaller block sizes (512B, 1K, 2K), some quotas straddle block
      boundaries such that the usage value is on one block and the rest
      of the quota is on the previous block. In such cases, the value
      does not get updated correctly. This patch fixes that by addressing
      the boundary conditions correctly.
      
      This patch also adds a (s64) cast that was missing in a call to
      gfs2_quota_change() in inode.c
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      39a72580
  15. 02 6月, 2015 1 次提交
    • T
      writeback: move bandwidth related fields from backing_dev_info into bdi_writeback · a88a341a
      Tejun Heo 提交于
      Currently, a bdi (backing_dev_info) embeds single wb (bdi_writeback)
      and the role of the separation is unclear.  For cgroup support for
      writeback IOs, a bdi will be updated to host multiple wb's where each
      wb serves writeback IOs of a different cgroup on the bdi.  To achieve
      that, a wb should carry all states necessary for servicing writeback
      IOs for a cgroup independently.
      
      This patch moves bandwidth related fields from backing_dev_info into
      bdi_writeback.
      
      * The moved fields are: bw_time_stamp, dirtied_stamp, written_stamp,
        write_bandwidth, avg_write_bandwidth, dirty_ratelimit,
        balanced_dirty_ratelimit, completions and dirty_exceeded.
      
      * writeback_chunk_size() and over_bground_thresh() now take @wb
        instead of @bdi.
      
      * bdi_writeout_fraction(bdi, ...)	-> wb_writeout_fraction(wb, ...)
        bdi_dirty_limit(bdi, ...)		-> wb_dirty_limit(wb, ...)
        bdi_position_ration(bdi, ...)		-> wb_position_ratio(wb, ...)
        bdi_update_writebandwidth(bdi, ...)	-> wb_update_write_bandwidth(wb, ...)
        [__]bdi_update_bandwidth(bdi, ...)	-> [__]wb_update_bandwidth(wb, ...)
        bdi_{max|min}_pause(bdi, ...)		-> wb_{max|min}_pause(wb, ...)
        bdi_dirty_limits(bdi, ...)		-> wb_dirty_limits(wb, ...)
      
      * Init/exits of the relocated fields are moved to bdi_wb_init/exit()
        respectively.  Note that explicit zeroing is dropped in the process
        as wb's are cleared in entirety anyway.
      
      * As there's still only one bdi_writeback per backing_dev_info, all
        uses of bdi->stat[] are mechanically replaced with bdi->wb.stat[]
        introducing no behavior changes.
      
      v2: Typo in description fixed as suggested by Jan.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Jaegeuk Kim <jaegeuk@kernel.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      a88a341a
  16. 19 5月, 2015 1 次提交
  17. 11 5月, 2015 2 次提交
    • A
      don't pass nameidata to ->follow_link() · 6e77137b
      Al Viro 提交于
      its only use is getting passed to nd_jump_link(), which can obtain
      it from current->nameidata
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6e77137b
    • A
      new ->follow_link() and ->put_link() calling conventions · 680baacb
      Al Viro 提交于
      a) instead of storing the symlink body (via nd_set_link()) and returning
      an opaque pointer later passed to ->put_link(), ->follow_link() _stores_
      that opaque pointer (into void * passed by address by caller) and returns
      the symlink body.  Returning ERR_PTR() on error, NULL on jump (procfs magic
      symlinks) and pointer to symlink body for normal symlinks.  Stored pointer
      is ignored in all cases except the last one.
      
      Storing NULL for opaque pointer (or not storing it at all) means no call
      of ->put_link().
      
      b) the body used to be passed to ->put_link() implicitly (via nameidata).
      Now only the opaque pointer is.  In the cases when we used the symlink body
      to free stuff, ->follow_link() now should store it as opaque pointer in addition
      to returning it.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      680baacb
  18. 06 5月, 2015 5 次提交
    • F
      gfs2: kerneldoc warning fixes · 1272574b
      Fabian Frederick 提交于
      Fixes the following kernel-doc warnings:
      Warning(fs/gfs2/aops.c:180): No description found for parameter 'wbc'
      Warning(fs/gfs2/aops.c:236): No description found for parameter 'end'
      Warning(fs/gfs2/aops.c:236): No description found for parameter 'done_index'
      Warning(fs/gfs2/aops.c:236): Excess function parameter 'writepage' description in 'gfs2_write_jdata_pagevec'
      Warning(fs/gfs2/aops.c:346): Excess function parameter 'writepage' description in 'gfs2_write_cache_jdata'
      Warning(fs/gfs2/aops.c:346): Excess function parameter 'data' description in 'gfs2_write_cache_jdata'
      Warning(fs/gfs2/aops.c:605): No description found for parameter 'file'
      Warning(fs/gfs2/aops.c:605): No description found for parameter 'mapping'
      Warning(fs/gfs2/aops.c:605): No description found for parameter 'pages'
      Warning(fs/gfs2/aops.c:605): No description found for parameter 'nr_pages'
      Warning(fs/gfs2/aops.c:870): No description found for parameter 'copied'
      Signed-off-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      1272574b
    • F
      gfs2: convert simple_str to kstr · e50ead48
      Fabian Frederick 提交于
      -Remove obsolete simple_str functions.
      -Return error code when kstr failed.
      -This patch also calls functions corresponding to destination type.
      
      Thanks to Alexey Dobriyan for suggesting improvements in
      block_store() and wdack_store()
      Signed-off-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      e50ead48
    • B
      GFS2: make sure S_NOSEC flag isn't overwritten · 01e64ee4
      Benjamin Marzinski 提交于
      At the end of gfs2_set_inode_flags inode->i_flags is set to flags, so
      we should be modifying flags instead of inode->i_flags, so it isn't
      overwritten.
      
      Signed-off-by: Benjamin Marzinski <bmarzins redhat com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      01e64ee4
    • B
      GFS2: add support for rename2 and RENAME_EXCHANGE · a63b7bbc
      Benjamin Marzinski 提交于
      gfs2 now uses the rename2 directory iop, and supports the
      RENAME_EXCHANGE flag (as well as RENAME_NOREPLACE, which the vfs
      takes care of).
      
      Signed-off-by: Benjamin Marzinski <bmarzins redhat com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      a63b7bbc
    • A
      gfs2: handle NULL rgd in set_rgrp_preferences · 959b6717
      Abhi Das 提交于
      The function set_rgrp_preferences() does not handle the (rarely
      returned) NULL value from gfs2_rgrpd_get_next() and this patch
      fixes that.
      
      The fs image in question is only 150MB in size which allows for
      only 1 rgrp to be created. The in-memory rb tree has only 1 node
      and when gfs2_rgrpd_get_next() is called on this sole rgrp, it
      returns NULL. (Default behavior is to wrap around the rb tree and
      return the first node to give the illusion of a circular linked
      list. In the case of only 1 rgrp, we can't have
      gfs2_rgrpd_get_next() return the same rgrp (first, last, next all
      point to the same rgrp)... that would cause unintended consequences
      and infinite loops.)
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      959b6717
  19. 02 5月, 2015 1 次提交
  20. 01 5月, 2015 1 次提交
    • B
      GFS2: mark the journal idle to fix ro mounts · 086cc672
      Benjamin Marzinski 提交于
      When gfs2 was mounted read-only and then unmounted, it was writing a
      header block to the journal in the syncing gfs2_log_flush() call from
      kill_sb(). This is because the journal was not being marked as idle
      until the first log header was written out, and on a read-only mount
      there never was a log header written out. Since the journal was not
      marked idle, gfs2_log_flush() was writing out a header lock to make
      sure it was empty during the sync.  Not only did this cause IO to a
      read-only filesystem, but the journalling isn't completely initialized
      on read-only mounts, and so gfs2 was writing out the wrong sequence
      number in the log header.
      
      Now, the journal is marked idle on mount, and gfs2_log_flush() won't
      write out anything until there starts being transactions to flush.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Acked-by: NSteven Whitehouse <swhiteho@redhat.com>
      086cc672
  21. 24 4月, 2015 2 次提交
  22. 16 4月, 2015 1 次提交
  23. 12 4月, 2015 4 次提交