Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Aug 2012 17:26:23 +0000 (10:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Aug 2012 17:26:23 +0000 (10:26 -0700)
Pull second vfs pile from Al Viro:
 "The stuff in there: fsfreeze deadlock fixes by Jan (essentially, the
  deadlock reproduced by xfstests 068), symlink and hardlink restriction
  patches, plus assorted cleanups and fixes.

  Note that another fsfreeze deadlock (emergency thaw one) is *not*
  dealt with - the series by Fernando conflicts a lot with Jan's, breaks
  userland ABI (FIFREEZE semantics gets changed) and trades the deadlock
  for massive vfsmount leak; this is going to be handled next cycle.
  There probably will be another pull request, but that stuff won't be
  in it."

Fix up trivial conflicts due to unrelated changes next to each other in
drivers/{staging/gdm72xx/usb_boot.c, usb/gadget/storage_common.c}

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (54 commits)
  delousing target_core_file a bit
  Documentation: Correct s_umount state for freeze_fs/unfreeze_fs
  fs: Remove old freezing mechanism
  ext2: Implement freezing
  btrfs: Convert to new freezing mechanism
  nilfs2: Convert to new freezing mechanism
  ntfs: Convert to new freezing mechanism
  fuse: Convert to new freezing mechanism
  gfs2: Convert to new freezing mechanism
  ocfs2: Convert to new freezing mechanism
  xfs: Convert to new freezing code
  ext4: Convert to new freezing mechanism
  fs: Protect write paths by sb_start_write - sb_end_write
  fs: Skip atime update on frozen filesystem
  fs: Add freezing handling to mnt_want_write() / mnt_drop_write()
  fs: Improve filesystem freezing handling
  switch the protection of percpu_counter list to spinlock
  nfsd: Push mnt_want_write() outside of i_mutex
  btrfs: Push mnt_want_write() outside of i_mutex
  fat: Push mnt_want_write() outside of i_mutex
  ...

39 files changed:
1  2 
Documentation/filesystems/Locking
Documentation/sysctl/fs.txt
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/bcm/Misc.c
drivers/staging/gdm72xx/sdio_boot.c
drivers/staging/gdm72xx/usb_boot.c
drivers/target/target_core_file.c
drivers/usb/gadget/storage_common.c
fs/btrfs/disk-io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/transaction.c
fs/exec.c
fs/ext2/super.c
fs/ext4/inode.c
fs/ext4/super.c
fs/gfs2/file.c
fs/inode.c
fs/lockd/svc4proc.c
fs/lockd/svclock.c
fs/lockd/svcproc.c
fs/nfsd/vfs.c
fs/nilfs2/ioctl.c
fs/pipe.c
fs/super.c
fs/xfs/xfs_aops.c
fs/xfs/xfs_file.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_sync.c
fs/xfs/xfs_trans.h
include/linux/fs.h
include/linux/mm.h
include/linux/pipe_fs_i.h
kernel/audit.c
kernel/sysctl.c
mm/memory.c
net/unix/af_unix.c

Simple merge
Simple merge
index 9a60d4cd2184aa188e80b946e5ba398bac04943f,7067af2fa61047ee7d5e8537fb48f76f6dc0ea85..f545716c666d06fac279d87bf8cfe69664eb595e
@@@ -155,14 -155,9 +155,9 @@@ static int create_worker_threads(struc
        return 0;
  }
  
 -static struct file *open_firmware_file(PMINI_ADAPTER Adapter, const char *path)
 +static struct file *open_firmware_file(struct bcm_mini_adapter *Adapter, const char *path)
  {
-       struct file *flp = NULL;
-       mm_segment_t oldfs;
-       oldfs = get_fs();
-       set_fs(get_ds());
-       flp = filp_open(path, O_RDONLY, S_IRWXU);
-       set_fs(oldfs);
+       struct file *flp = filp_open(path, O_RDONLY, S_IRWXU);
        if (IS_ERR(flp)) {
                pr_err(DRV_NAME "Unable To Open File %s, err %ld", path, PTR_ERR(flp));
                flp = NULL;
        return status;
  }
  
 -static int bcm_parse_target_params(PMINI_ADAPTER Adapter)
 +static int bcm_parse_target_params(struct bcm_mini_adapter *Adapter)
  {
        struct file *flp = NULL;
-       mm_segment_t oldfs = {0};
        char *buff;
        int len = 0;
-       loff_t pos = 0;
  
        buff = kmalloc(BUFFER_1K, GFP_KERNEL);
        if (!buff)
Simple merge
index fef290c38db67ae8620a8ff92179275fb564730b,b366a54386fbb372cda610693f411c4042a99039..e3dbd5a552ca00c1349f2ea7f20fc629a7ddc5e5
@@@ -173,8 -174,7 +173,7 @@@ int usb_boot(struct usb_device *usbdev
        filp = filp_open(img_name, O_RDONLY | O_LARGEFILE, 0);
        if (IS_ERR(filp)) {
                printk(KERN_ERR "Can't find %s.\n", img_name);
-               set_fs(fs);
 -              ret = -ENOENT;
 +              ret = PTR_ERR(filp);
                goto restore_fs;
        }
  
Simple merge
index ae8b18869b8c0189b6ef2d2c68760cb12e2307e5,f92943246820fb302f82204bdd120b42228c5a09..8d9bcd8207c8d1fee7e47813d7d6ee7f76ca0b6b
@@@ -709,12 -706,6 +708,11 @@@ static int fsg_lun_open(struct fsg_lun 
                goto out;
        }
  
-       get_file(filp);
 +      if (fsg_lun_is_open(curlun))
 +              fsg_lun_close(curlun);
 +
 +      curlun->blksize = blksize;
 +      curlun->blkbits = blkbits;
        curlun->ro = ro;
        curlun->filp = filp;
        curlun->file_length = size;
Simple merge
Simple merge
Simple merge
index 7ac7cdcc294e5dc561bc6916efec59dacf320884,fa67ba51516e9c1b5d7b23efaddc3068116fda08..17be3dedacbab1c47084270153ed059719984470
@@@ -545,9 -530,9 +548,11 @@@ static int __btrfs_end_transaction(stru
                }
                count++;
        }
 +      btrfs_trans_release_metadata(trans, root);
 +      trans->block_rsv = NULL;
  
+       sb_end_intwrite(root->fs_info->sb);
        if (lock && !atomic_read(&root->fs_info->open_ioctl_trans) &&
            should_end_transaction(trans, root)) {
                trans->transaction->blocked = 1;
diff --cc fs/exec.c
Simple merge
diff --cc fs/ext2/super.c
Simple merge
diff --cc fs/ext4/inode.c
Simple merge
diff --cc fs/ext4/super.c
Simple merge
diff --cc fs/gfs2/file.c
index 9aa6af13823c5b75d3e8d2723d281dc79cee7a47,8ffeb031248e0b26799eba6b16dda84fe94f3cf6..d1d791ef38de2188852551254a63f974a605feff
@@@ -373,19 -369,12 +373,18 @@@ static int gfs2_page_mkwrite(struct vm_
        loff_t size;
        int ret;
  
-       /* Wait if fs is frozen. This is racy so we check again later on
-        * and retry if the fs has been frozen after the page lock has
-        * been acquired
-        */
-       vfs_check_frozen(inode->i_sb, SB_FREEZE_WRITE);
+       sb_start_pagefault(inode->i_sb);
+       /* Update file times before taking page lock */
+       file_update_time(vma->vm_file);
  
 +      ret = gfs2_rs_alloc(ip);
 +      if (ret)
 +              return ret;
 +
 +      atomic_set(&ip->i_res->rs_sizehint,
 +                 PAGE_CACHE_SIZE >> sdp->sd_sb.sb_bsize_shift);
 +
        gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
        ret = gfs2_glock_nq(&gh);
        if (ret)
diff --cc fs/inode.c
index 3cc50432046796df30834106966c4a295294b7fb,74d7c20fac88b3ba74d32a31f8537d7f15e8cc3d..ac8d904b3f1624bfa945ba088d2909e740e16a6c
@@@ -1551,11 -1553,11 +1553,13 @@@ void touch_atime(struct path *path
         * Btrfs), but since we touch atime while walking down the path we
         * really don't care if we failed to update the atime of the file,
         * so just ignore the return value.
 +       * We may also fail on filesystems that have the ability to make parts
 +       * of the fs read only, e.g. subvolumes in Btrfs.
         */
        update_time(inode, &now, S_ATIME);
-       mnt_drop_write(mnt);
+       __mnt_drop_write(mnt);
+ skip_update:
+       sb_end_write(inode->i_sb);
  }
  EXPORT_SYMBOL(touch_atime);
  
Simple merge
Simple merge
Simple merge
diff --cc fs/nfsd/vfs.c
Simple merge
Simple merge
diff --cc fs/pipe.c
Simple merge
diff --cc fs/super.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/audit.c
Simple merge
diff --cc kernel/sysctl.c
Simple merge
diff --cc mm/memory.c
Simple merge
Simple merge