Merge tag 'xfs-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Sep 2015 20:28:32 +0000 (13:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Sep 2015 20:28:32 +0000 (13:28 -0700)
Pull xfs updates from Dave Chinner:
 "There isn't a whole lot to this update - it's mostly bug fixes and
  they are spread pretty much all over XFS.  There are some corruption
  fixes, some fixes for log recovery, some fixes that prevent unount
  from hanging, a lockdep annotation rework for inode locking to prevent
  false positives and the usual random bunch of cleanups and minor
  improvements.

  Deatils:

   - large rework of EFI/EFD lifecycle handling to fix log recovery
     corruption issues, crashes and unmount hangs

   - separate metadata UUID on disk to enable changing boot label UUID
     for v5 filesystems

   - fixes for gcc miscompilation on certain platforms and optimisation
     levels

   - remote attribute allocation and recovery corruption fixes

   - inode lockdep annotation rework to fix bugs with too many
     subclasses

   - directory inode locking changes to prevent lockdep false positives

   - a handful of minor corruption fixes

   - various other small cleanups and bug fixes"

* tag 'xfs-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs: (42 commits)
  xfs: fix error gotos in xfs_setattr_nonsize
  xfs: add mssing inode cache attempts counter increment
  xfs: return errors from partial I/O failures to files
  libxfs: bad magic number should set da block buffer error
  xfs: fix non-debug build warnings
  xfs: collapse allocsize and biosize mount option handling
  xfs: Fix file type directory corruption for btree directories
  xfs: lockdep annotations throw warnings on non-debug builds
  xfs: Fix uninitialized return value in xfs_alloc_fix_freelist()
  xfs: inode lockdep annotations broke non-lockdep build
  xfs: flush entire file on dio read/write to cached file
  xfs: Fix xfs_attr_leafblock definition
  libxfs: readahead of dir3 data blocks should use the read verifier
  xfs: stop holding ILOCK over filldir callbacks
  xfs: clean up inode lockdep annotations
  xfs: swap leaf buffer into path struct atomically during path shift
  xfs: relocate sparse inode mount warning
  xfs: dquots should be stamped with sb_meta_uuid
  xfs: log recovery needs to validate against sb_meta_uuid
  xfs: growfs not aware of sb_meta_uuid
  ...

1  2 
fs/xfs/xfs_aops.c
fs/xfs/xfs_buf.c
fs/xfs/xfs_super.c

diff --combined fs/xfs/xfs_aops.c
@@@ -119,7 -119,8 +119,7 @@@ xfs_setfilesize_trans_alloc
         * We may pass freeze protection with a transaction.  So tell lockdep
         * we released it.
         */
 -      rwsem_release(&ioend->io_inode->i_sb->s_writers.lock_map[SB_FREEZE_FS-1],
 -                    1, _THIS_IP_);
 +      __sb_writers_release(ioend->io_inode->i_sb, SB_FREEZE_FS);
        /*
         * We hand off the transaction to the completion thread now, so
         * clear the flag here.
@@@ -170,7 -171,8 +170,7 @@@ xfs_setfilesize_ioend
         * Similarly for freeze protection.
         */
        current_set_flags_nested(&tp->t_pflags, PF_FSTRANS);
 -      rwsem_acquire_read(&VFS_I(ip)->i_sb->s_writers.lock_map[SB_FREEZE_FS-1],
 -                         0, 1, _THIS_IP_);
 +      __sb_writers_acquired(VFS_I(ip)->i_sb, SB_FREEZE_FS);
  
        return xfs_setfilesize(ip, tp, ioend->io_offset, ioend->io_size);
  }
@@@ -349,11 -351,13 +349,12 @@@ xfs_imap_valid
   */
  STATIC void
  xfs_end_bio(
 -      struct bio              *bio,
 -      int                     error)
 +      struct bio              *bio)
  {
        xfs_ioend_t             *ioend = bio->bi_private;
  
-       ioend->io_error = bio->bi_error;
 -      if (!ioend->io_error && !test_bit(BIO_UPTODATE, &bio->bi_flags))
 -              ioend->io_error = error;
++      if (!ioend->io_error)
++              ioend->io_error = bio->bi_error;
  
        /* Toss bio and pass work off to an xfsdatad thread */
        bio->bi_private = NULL;
@@@ -379,7 -383,8 +380,7 @@@ STATIC struct bio 
  xfs_alloc_ioend_bio(
        struct buffer_head      *bh)
  {
 -      int                     nvecs = bio_get_nr_vecs(bh->b_bdev);
 -      struct bio              *bio = bio_alloc(GFP_NOIO, nvecs);
 +      struct bio              *bio = bio_alloc(GFP_NOIO, BIO_MAX_PAGES);
  
        ASSERT(bio->bi_private == NULL);
        bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
diff --combined fs/xfs/xfs_buf.c
@@@ -438,7 -438,6 +438,6 @@@ _xfs_buf_find
        xfs_buf_flags_t         flags,
        xfs_buf_t               *new_bp)
  {
-       size_t                  numbytes;
        struct xfs_perag        *pag;
        struct rb_node          **rbp;
        struct rb_node          *parent;
  
        for (i = 0; i < nmaps; i++)
                numblks += map[i].bm_len;
-       numbytes = BBTOB(numblks);
  
        /* Check for IOs smaller than the sector size / not sector aligned */
-       ASSERT(!(numbytes < btp->bt_meta_sectorsize));
+       ASSERT(!(BBTOB(numblks) < btp->bt_meta_sectorsize));
        ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_meta_sectormask));
  
        /*
@@@ -1096,7 -1094,8 +1094,7 @@@ xfs_bwrite
  
  STATIC void
  xfs_buf_bio_end_io(
 -      struct bio              *bio,
 -      int                     error)
 +      struct bio              *bio)
  {
        xfs_buf_t               *bp = (xfs_buf_t *)bio->bi_private;
  
         * don't overwrite existing errors - otherwise we can lose errors on
         * buffers that require multiple bios to complete.
         */
 -      if (error) {
 +      if (bio->bi_error) {
                spin_lock(&bp->b_lock);
                if (!bp->b_io_error)
 -                      bp->b_io_error = error;
 +                      bp->b_io_error = bio->bi_error;
                spin_unlock(&bp->b_lock);
        }
  
@@@ -1532,9 -1531,10 +1530,10 @@@ xfs_wait_buftarg
                        list_del_init(&bp->b_lru);
                        if (bp->b_flags & XBF_WRITE_FAIL) {
                                xfs_alert(btp->bt_mount,
- "Corruption Alert: Buffer at block 0x%llx had permanent write failures!\n"
- "Please run xfs_repair to determine the extent of the problem.",
+ "Corruption Alert: Buffer at block 0x%llx had permanent write failures!",
                                        (long long)bp->b_bn);
+                               xfs_alert(btp->bt_mount,
+ "Please run xfs_repair to determine the extent of the problem.");
                        }
                        xfs_buf_rele(bp);
                }
diff --combined fs/xfs/xfs_super.c
@@@ -261,16 -261,8 +261,8 @@@ xfs_parseargs
                        mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
                        if (!mp->m_rtname)
                                return -ENOMEM;
-               } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
-                       if (!value || !*value) {
-                               xfs_warn(mp, "%s option requires an argument",
-                                       this_char);
-                               return -EINVAL;
-                       }
-                       if (kstrtoint(value, 10, &iosize))
-                               return -EINVAL;
-                       iosizelog = ffs(iosize) - 1;
-               } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
+               } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) ||
+                          !strcmp(this_char, MNTOPT_BIOSIZE)) {
                        if (!value || !*value) {
                                xfs_warn(mp, "%s option requires an argument",
                                        this_char);
@@@ -511,9 -503,9 +503,9 @@@ xfs_showargs
                seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10);
  
        if (mp->m_logname)
 -              seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname);
 +              seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname);
        if (mp->m_rtname)
 -              seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname);
 +              seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname);
  
        if (mp->m_dalign > 0)
                seq_printf(m, "," MNTOPT_SUNIT "=%d",
@@@ -1528,6 -1520,10 +1520,10 @@@ xfs_fs_fill_super
                }
        }
  
+       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+               xfs_alert(mp,
+       "EXPERIMENTAL sparse inode feature enabled. Use at your own risk!");
        error = xfs_mountfs(mp);
        if (error)
                goto out_filestream_unmount;