]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 10 Jun 2017 18:09:23 +0000 (11:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 10 Jun 2017 18:09:23 +0000 (11:09 -0700)
Pull UFS fixes from Al Viro:
 "This is just the obvious backport fodder; I'm pretty sure that there
  will be more - definitely so wrt performance and quite possibly
  correctness as well"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  ufs: we need to sync inode before freeing it
  excessive checks in ufs_write_failed() and ufs_evict_inode()
  ufs_getfrag_block(): we only grab ->truncate_mutex on block creation path
  ufs_extend_tail(): fix the braino in calling conventions of ufs_new_fragments()
  ufs: set correct ->s_maxsize
  ufs: restore maintaining ->i_blocks
  fix ufs_isblockset()
  ufs: restore proper tail allocation

1  2 
fs/ufs/super.c

diff --combined fs/ufs/super.c
index 29ecaf739449c4036e6ed3ebed5499b8489079c4,d9aa2627c9dfd0f9310d1a83678144ba4a81437b..878cc6264f1af4a87bf68bb71f2cb031bdb4b1a1
@@@ -746,6 -746,23 +746,23 @@@ static void ufs_put_super(struct super_
        return;
  }
  
+ static u64 ufs_max_bytes(struct super_block *sb)
+ {
+       struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
+       int bits = uspi->s_apbshift;
+       u64 res;
+       if (bits > 21)
+               res = ~0ULL;
+       else
+               res = UFS_NDADDR + (1LL << bits) + (1LL << (2*bits)) +
+                       (1LL << (3*bits));
+       if (res >= (MAX_LFS_FILESIZE >> uspi->s_bshift))
+               return MAX_LFS_FILESIZE;
+       return res << uspi->s_bshift;
+ }
  static int ufs_fill_super(struct super_block *sb, void *data, int silent)
  {
        struct ufs_sb_info * sbi;
        uspi->s_dirblksize = UFS_SECTOR_SIZE;
        super_block_offset=UFS_SBLOCK;
  
 -      /* Keep 2Gig file limit. Some UFS variants need to override 
 -         this but as I don't know which I'll let those in the know loosen
 -         the rules */
 +      sb->s_maxbytes = MAX_LFS_FILESIZE;
 +
        switch (sbi->s_mount_opt & UFS_MOUNT_UFSTYPE) {
        case UFS_MOUNT_UFSTYPE_44BSD:
                UFSD("ufstype=44bsd\n");
@@@ -1211,6 -1229,7 +1228,7 @@@ magic_found
                            "fast symlink size (%u)\n", uspi->s_maxsymlinklen);
                uspi->s_maxsymlinklen = maxsymlen;
        }
+       sb->s_maxbytes = ufs_max_bytes(sb);
        sb->s_max_links = UFS_LINK_MAX;
  
        inode = ufs_iget(sb, UFS_ROOTINO);