]> Pileus Git - ~andy/linux/commitdiff
Merge tag 'xfs-for-linus-v3.12-rc1' of git://oss.sgi.com/xfs/xfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Sep 2013 18:19:09 +0000 (11:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Sep 2013 18:19:09 +0000 (11:19 -0700)
Pull xfs updates from Ben Myers:
 "For 3.12-rc1 there are a number of bugfixes in addition to work to
  ease usage of shared code between libxfs and the kernel, the rest of
  the work to enable project and group quotas to be used simultaneously,
  performance optimisations in the log and the CIL, directory entry file
  type support, fixes for log space reservations, some spelling/grammar
  cleanups, and the addition of user namespace support.

   - introduce readahead to log recovery
   - add directory entry file type support
   - fix a number of spelling errors in comments
   - introduce new Q_XGETQSTATV quotactl for project quotas
   - add USER_NS support
   - log space reservation rework
   - CIL optimisations
  - kernel/userspace libxfs rework"

* tag 'xfs-for-linus-v3.12-rc1' of git://oss.sgi.com/xfs/xfs: (112 commits)
  xfs: XFS_MOUNT_QUOTA_ALL needed by userspace
  xfs: dtype changed xfs_dir2_sfe_put_ino to xfs_dir3_sfe_put_ino
  Fix wrong flag ASSERT in xfs_attr_shortform_getvalue
  xfs: finish removing IOP_* macros.
  xfs: inode log reservations are too small
  xfs: check correct status variable for xfs_inobt_get_rec() call
  xfs: inode buffers may not be valid during recovery readahead
  xfs: check LSN ordering for v5 superblocks during recovery
  xfs: btree block LSN escaping to disk uninitialised
  XFS: Assertion failed: first <= last && last < BBTOB(bp->b_length), file: fs/xfs/xfs_trans_buf.c, line: 568
  xfs: fix bad dquot buffer size in log recovery readahead
  xfs: don't account buffer cancellation during log recovery readahead
  xfs: check for underflow in xfs_iformat_fork()
  xfs: xfs_dir3_sfe_put_ino can be static
  xfs: introduce object readahead to log recovery
  xfs: Simplify xfs_ail_min() with list_first_entry_or_null()
  xfs: Register hotcpu notifier after initialization
  xfs: add xfs sb v4 support for dirent filetype field
  xfs: Add write support for dirent filetype field
  xfs: Add read-only support for dirent filetype field
  ...

1  2 
fs/xfs/xfs_aops.c
init/Kconfig
kernel/capability.c

diff --combined fs/xfs/xfs_aops.c
index e11d654af786b580086f188f72881fe7416ca928,2f9fb421915a6a09ffad9668070ac0b335ef7e7d..977da0ec66047eedacb3298ebec57de3a2968f0c
@@@ -28,9 -28,9 +28,9 @@@
  #include "xfs_alloc.h"
  #include "xfs_error.h"
  #include "xfs_iomap.h"
- #include "xfs_vnodeops.h"
  #include "xfs_trace.h"
  #include "xfs_bmap.h"
+ #include "xfs_bmap_util.h"
  #include <linux/aio.h>
  #include <linux/gfp.h>
  #include <linux/mpage.h>
@@@ -86,6 -86,14 +86,6 @@@ xfs_destroy_ioend
                bh->b_end_io(bh, !ioend->io_error);
        }
  
 -      if (ioend->io_iocb) {
 -              inode_dio_done(ioend->io_inode);
 -              if (ioend->io_isasync) {
 -                      aio_complete(ioend->io_iocb, ioend->io_error ?
 -                                      ioend->io_error : ioend->io_result, 0);
 -              }
 -      }
 -
        mempool_free(ioend, xfs_ioend_pool);
  }
  
@@@ -108,7 -116,7 +108,7 @@@ xfs_setfilesize_trans_alloc
  
        tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
  
-       error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
+       error = xfs_trans_reserve(tp, &M_RES(mp)->tr_fsyncts, 0, 0);
        if (error) {
                xfs_trans_cancel(tp, 0);
                return error;
@@@ -273,6 -281,7 +273,6 @@@ xfs_alloc_ioend
         * all the I/O from calling the completion routine too early.
         */
        atomic_set(&ioend->io_remaining, 1);
 -      ioend->io_isasync = 0;
        ioend->io_isdirect = 0;
        ioend->io_error = 0;
        ioend->io_list = NULL;
        ioend->io_buffer_tail = NULL;
        ioend->io_offset = 0;
        ioend->io_size = 0;
 -      ioend->io_iocb = NULL;
 -      ioend->io_result = 0;
        ioend->io_append_trans = NULL;
  
        INIT_WORK(&ioend->io_work, xfs_end_io);
@@@ -440,7 -451,7 +440,7 @@@ xfs_start_page_writeback
                end_page_writeback(page);
  }
  
- static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)
+ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh)
  {
        return bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
  }
@@@ -514,7 -525,7 +514,7 @@@ xfs_submit_ioend
                                goto retry;
                        }
  
-                       if (bio_add_buffer(bio, bh) != bh->b_size) {
+                       if (xfs_bio_add_buffer(bio, bh) != bh->b_size) {
                                xfs_submit_ioend_bio(wbc, ioend, bio);
                                goto retry;
                        }
@@@ -1281,10 -1292,8 +1281,10 @@@ __xfs_get_blocks
                if (create || !ISUNWRITTEN(&imap))
                        xfs_map_buffer(inode, bh_result, &imap, offset);
                if (create && ISUNWRITTEN(&imap)) {
 -                      if (direct)
 +                      if (direct) {
                                bh_result->b_private = inode;
 +                              set_buffer_defer_completion(bh_result);
 +                      }
                        set_buffer_unwritten(bh_result);
                }
        }
@@@ -1381,7 -1390,9 +1381,7 @@@ xfs_end_io_direct_write
        struct kiocb            *iocb,
        loff_t                  offset,
        ssize_t                 size,
 -      void                    *private,
 -      int                     ret,
 -      bool                    is_async)
 +      void                    *private)
  {
        struct xfs_ioend        *ioend = iocb->private;
  
  
        ioend->io_offset = offset;
        ioend->io_size = size;
 -      ioend->io_iocb = iocb;
 -      ioend->io_result = ret;
        if (private && size > 0)
                ioend->io_type = XFS_IO_UNWRITTEN;
  
 -      if (is_async) {
 -              ioend->io_isasync = 1;
 -              xfs_finish_ioend(ioend);
 -      } else {
 -              xfs_finish_ioend_sync(ioend);
 -      }
 +      xfs_finish_ioend_sync(ioend);
  }
  
  STATIC ssize_t
@@@ -1498,13 -1516,26 +1498,26 @@@ xfs_vm_write_failed
        loff_t                  pos,
        unsigned                len)
  {
-       loff_t                  block_offset = pos & PAGE_MASK;
+       loff_t                  block_offset;
        loff_t                  block_start;
        loff_t                  block_end;
        loff_t                  from = pos & (PAGE_CACHE_SIZE - 1);
        loff_t                  to = from + len;
        struct buffer_head      *bh, *head;
  
+       /*
+        * The request pos offset might be 32 or 64 bit, this is all fine
+        * on 64-bit platform.  However, for 64-bit pos request on 32-bit
+        * platform, the high 32-bit will be masked off if we evaluate the
+        * block_offset via (pos & PAGE_MASK) because the PAGE_MASK is
+        * 0xfffff000 as an unsigned long, hence the result is incorrect
+        * which could cause the following ASSERT failed in most cases.
+        * In order to avoid this, we can evaluate the block_offset of the
+        * start of the page by using shifts rather than masks the mismatch
+        * problem.
+        */
+       block_offset = (pos >> PAGE_CACHE_SHIFT) << PAGE_CACHE_SHIFT;
        ASSERT(block_offset + from == pos);
  
        head = page_buffers(page);
diff --combined init/Kconfig
index 0a2c4bcf179e21d321b25206718cb58aad722b54,a7bcd87ca384c3751d30f4229e961e7400ef0b9e..bfa9e13c9a939d34045bb8a360aef1743093b800
@@@ -470,7 -470,6 +470,7 @@@ config TREE_RC
  config TREE_PREEMPT_RCU
        bool "Preemptible tree-based hierarchical RCU"
        depends on PREEMPT
 +      select IRQ_WORK
        help
          This option selects the RCU implementation that is
          designed for very large SMP systems with hundreds or
@@@ -528,29 -527,13 +528,29 @@@ config RCU_USER_Q
  config CONTEXT_TRACKING_FORCE
        bool "Force context tracking"
        depends on CONTEXT_TRACKING
 -      default CONTEXT_TRACKING
 +      default y if !NO_HZ_FULL
        help
 -        Probe on user/kernel boundaries by default in order to
 -        test the features that rely on it such as userspace RCU extended
 -        quiescent states.
 -        This test is there for debugging until we have a real user like the
 -        full dynticks mode.
 +        The major pre-requirement for full dynticks to work is to
 +        support the context tracking subsystem. But there are also
 +        other dependencies to provide in order to make the full
 +        dynticks working.
 +
 +        This option stands for testing when an arch implements the
 +        context tracking backend but doesn't yet fullfill all the
 +        requirements to make the full dynticks feature working.
 +        Without the full dynticks, there is no way to test the support
 +        for context tracking and the subsystems that rely on it: RCU
 +        userspace extended quiescent state and tickless cputime
 +        accounting. This option copes with the absence of the full
 +        dynticks subsystem by forcing the context tracking on all
 +        CPUs in the system.
 +
 +        Say Y only if you're working on the developpement of an
 +        architecture backend for the context tracking.
 +
 +        Say N otherwise, this option brings an overhead that you
 +        don't want in production.
 +
  
  config RCU_FANOUT
        int "Tree-based hierarchical RCU fanout value"
@@@ -972,7 -955,7 +972,7 @@@ config MEMCG_SWAP_ENABLE
          Memory Resource Controller Swap Extension comes with its price in
          a bigger memory consumption. General purpose distribution kernels
          which want to enable the feature but keep it disabled by default
 -        and let the user enable it by swapaccount boot command line
 +        and let the user enable it by swapaccount=1 boot command line
          parameter should have this option unselected.
          For those who want to have the feature enabled by default should
          select this option (if, for some reason, they need to disable it
@@@ -1123,7 -1106,6 +1123,6 @@@ config IPC_N
  
  config USER_NS
        bool "User namespace"
-       depends on UIDGID_CONVERTED
        select UIDGID_STRICT_TYPE_CHECKS
  
        default n
@@@ -1157,20 -1139,8 +1156,8 @@@ config NET_N
  
  endif # NAMESPACES
  
- config UIDGID_CONVERTED
-       # True if all of the selected software conmponents are known
-       # to have uid_t and gid_t converted to kuid_t and kgid_t
-       # where appropriate and are otherwise safe to use with
-       # the user namespace.
-       bool
-       default y
-       # Filesystems
-       depends on XFS_FS = n
  config UIDGID_STRICT_TYPE_CHECKS
        bool "Require conversions between uid/gids and their internal representation"
-       depends on UIDGID_CONVERTED
        default n
        help
         While the nececessary conversions are being added to all subsystems this option allows
diff --combined kernel/capability.c
index 6fc1c8af44df745bad512e02be04645984d1b5a1,a4b67446dc8726dfa06cec8d1460468c3bb6a367..4e66bf9275b03edf3c62e0e350afc5248f2b00b8
@@@ -432,6 -432,18 +432,6 @@@ bool capable(int cap
  }
  EXPORT_SYMBOL(capable);
  
 -/**
 - * nsown_capable - Check superior capability to one's own user_ns
 - * @cap: The capability in question
 - *
 - * Return true if the current task has the given superior capability
 - * targeted at its own user namespace.
 - */
 -bool nsown_capable(int cap)
 -{
 -      return ns_capable(current_user_ns(), cap);
 -}
 -
  /**
   * inode_capable - Check superior capability over inode
   * @inode: The inode in question
@@@ -452,3 -464,4 +452,4 @@@ bool inode_capable(const struct inode *
  
        return ns_capable(ns, cap) && kuid_has_mapping(ns, inode->i_uid);
  }
+ EXPORT_SYMBOL(inode_capable);