1. 28 Nov, 2014 3 commits
  2. 25 Oct, 2014 4 commits
  3. 24 Oct, 2014 1 commit
    • Al Viro's avatar
      fix inode leaks on d_splice_alias() failure exits · 51486b90
      Al Viro authored
      d_splice_alias() callers expect it to either stash the inode reference
      into a new alias, or drop the inode reference.  That makes it possible
      to just return d_splice_alias() result from ->lookup() instance, without
      any extra housekeeping required.
      
      Unfortunately, that should include the failure exits.  If d_splice_alias()
      returns an error, it leaves the dentry it has been given negative and
      thus it *must* drop the inode reference.  Easily fixed, but it goes way
      back and will need backporting.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      51486b90
  4. 23 Oct, 2014 12 commits
    • Miklos Szeredi's avatar
      fs: limit filesystem stacking depth · 69c433ed
      Miklos Szeredi authored
      Add a simple read-only counter to super_block that indicates how deep this
      is in the stack of filesystems.  Previously ecryptfs was the only stackable
      filesystem and it explicitly disallowed multiple layers of itself.
      
      Overlayfs, however, can be stacked recursively and also may be stacked
      on top of ecryptfs or vice versa.
      
      To limit the kernel stack usage we must limit the depth of the
      filesystem stack.  Initially the limit is set to 2.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      69c433ed
    • Erez Zadok's avatar
      overlayfs: implement show_options · f45827e8
      Erez Zadok authored
      This is useful because of the stacking nature of overlayfs.  Users like to
      find out (via /proc/mounts) which lower/upper directory were used at mount
      time.
      
      AV: even failing ovl_parse_opt() could've done some kstrdup()
      AV: failure of ovl_alloc_entry() should end up with ENOMEM, not EINVAL
      Signed-off-by: default avatarErez Zadok <ezk@cs.sunysb.edu>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      f45827e8
    • Andy Whitcroft's avatar
      overlayfs: add statfs support · cc259639
      Andy Whitcroft authored
      Add support for statfs to the overlayfs filesystem.  As the upper layer
      is the target of all write operations assume that the space in that
      filesystem is the space in the overlayfs.  There will be some inaccuracy as
      overwriting a file will copy it up and consume space we were not expecting,
      but it is better than nothing.
      
      Use the upper layer dentry and mount from the overlayfs root inode,
      passing the statfs call to that filesystem.
      Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      cc259639
    • Miklos Szeredi's avatar
      overlay filesystem · e9be9d5e
      Miklos Szeredi authored
      Overlayfs allows one, usually read-write, directory tree to be
      overlaid onto another, read-only directory tree.  All modifications
      go to the upper, writable layer.
      
      This type of mechanism is most often used for live CDs but there's a
      wide variety of other uses.
      
      The implementation differs from other "union filesystem"
      implementations in that after a file is opened all operations go
      directly to the underlying, lower or upper, filesystems.  This
      simplifies the implementation and allows native performance in these
      cases.
      
      The dentry tree is duplicated from the underlying filesystems, this
      enables fast cached lookups without adding special support into the
      VFS.  This uses slightly more memory than union mounts, but dentries
      are relatively small.
      
      Currently inodes are duplicated as well, but it is a possible
      optimization to share inodes for non-directories.
      
      Opening non directories results in the open forwarded to the
      underlying filesystem.  This makes the behavior very similar to union
      mounts (with the same limitations vs. fchmod/fchown on O_RDONLY file
      descriptors).
      
      Usage:
      
        mount -t overlayfs overlayfs -olowerdir=/lower,upperdir=/upper/upper,workdir=/upper/work /overlay
      
      The following cotributions have been folded into this patch:
      
      Neil Brown <neilb@suse.de>:
       - minimal remount support
       - use correct seek function for directories
       - initialise is_real before use
       - rename ovl_fill_cache to ovl_dir_read
      
      Felix Fietkau <nbd@openwrt.org>:
       - fix a deadlock in ovl_dir_read_merged
       - fix a deadlock in ovl_remove_whiteouts
      
      Erez Zadok <ezk@fsl.cs.sunysb.edu>
       - fix cleanup after WARN_ON
      
      Sedat Dilek <sedat.dilek@googlemail.com>
       - fix up permission to confirm to new API
      
      Robin Dong <hao.bigrat@gmail.com>
       - fix possible leak in ovl_new_inode
       - create new inode in ovl_link
      
      Andy Whitcroft <apw@canonical.com>
       - switch to __inode_permission()
       - copy up i_uid/i_gid from the underlying inode
      
      AV:
       - ovl_copy_up_locked() - dput(ERR_PTR(...)) on two failure exits
       - ovl_clear_empty() - one failure exit forgetting to do unlock_rename(),
         lack of check for udir being the parent of upper, dropping and regaining
         the lock on udir (which would require _another_ check for parent being
         right).
       - bogus d_drop() in copyup and rename [fix from your mail]
       - copyup/remove and copyup/rename races [fix from your mail]
       - ovl_dir_fsync() leaving ERR_PTR() in ->realfile
       - ovl_entry_free() is pointless - it's just a kfree_rcu()
       - fold ovl_do_lookup() into ovl_lookup()
       - manually assigning ->d_op is wrong.  Just use ->s_d_op.
       [patches picked from Miklos]:
       * copyup/remove and copyup/rename races
       * bogus d_drop() in copyup and rename
      
      Also thanks to the following people for testing and reporting bugs:
      
        Jordi Pujol <jordipujolp@gmail.com>
        Andy Whitcroft <apw@canonical.com>
        Michal Suchanek <hramrach@centrum.cz>
        Felix Fietkau <nbd@openwrt.org>
        Erez Zadok <ezk@fsl.cs.sunysb.edu>
        Randy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      e9be9d5e
    • Miklos Szeredi's avatar
      ext4: support RENAME_WHITEOUT · cd808dec
      Miklos Szeredi authored
      Add whiteout support to ext4_rename().  A whiteout inode (chrdev/0,0) is
      created before the rename takes place.  The whiteout inode is added to the
      old entry instead of deleting it.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      cd808dec
    • Miklos Szeredi's avatar
      vfs: add RENAME_WHITEOUT · 0d7a8555
      Miklos Szeredi authored
      This adds a new RENAME_WHITEOUT flag.  This flag makes rename() create a
      whiteout of source.  The whiteout creation is atomic relative to the
      rename.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      0d7a8555
    • Miklos Szeredi's avatar
      vfs: add whiteout support · 787fb6bc
      Miklos Szeredi authored
      Whiteout isn't actually a new file type, but is represented as a char
      device (Linus's idea) with 0/0 device number.
      
      This has several advantages compared to introducing a new whiteout file
      type:
      
       - no userspace API changes (e.g. trivial to make backups of upper layer
         filesystem, without losing whiteouts)
      
       - no fs image format changes (you can boot an old kernel/fsck without
         whiteout support and things won't break)
      
       - implementation is trivial
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      787fb6bc
    • Miklos Szeredi's avatar
      vfs: export check_sticky() · cbdf35bc
      Miklos Szeredi authored
      It's already duplicated in btrfs and about to be used in overlayfs too.
      
      Move the sticky bit check to an inline helper and call the out-of-line
      helper only in the unlikly case of the sticky bit being set.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      cbdf35bc
    • Miklos Szeredi's avatar
      vfs: introduce clone_private_mount() · c771d683
      Miklos Szeredi authored
      Overlayfs needs a private clone of the mount, so create a function for
      this and export to modules.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      c771d683
    • Miklos Szeredi's avatar
      vfs: export __inode_permission() to modules · bd5d0856
      Miklos Szeredi authored
      We need to be able to check inode permissions (but not filesystem implied
      permissions) for stackable filesystems.  Expose this interface for overlayfs.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      bd5d0856
    • Miklos Szeredi's avatar
      vfs: export do_splice_direct() to modules · 1c118596
      Miklos Szeredi authored
      Export do_splice_direct() to modules.  Needed by overlay filesystem.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      1c118596
    • Miklos Szeredi's avatar
      vfs: add i_op->dentry_open() · 4aa7c634
      Miklos Szeredi authored
      Add a new inode operation i_op->dentry_open().  This is for stacked filesystems
      that want to return a struct file from a different filesystem.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      4aa7c634
  5. 19 Oct, 2014 1 commit
  6. 17 Oct, 2014 2 commits
  7. 16 Oct, 2014 12 commits
    • Steve French's avatar
    • Steve French's avatar
      Workaround Mac server problem · b5b374ea
      Steve French authored
      Mac server returns that they support CIFS Unix Extensions but
      doesn't actually support QUERY_FILE_UNIX_BASIC so mount fails.
      
      Workaround this problem by disabling use of Unix CIFS protocol
      extensions if server returns an EOPNOTSUPP error on
      QUERY_FILE_UNIX_BASIC during mount.
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      b5b374ea
    • Steve French's avatar
      Remap reserved posix characters by default (part 3/3) · 2baa2682
      Steve French authored
      This is a bigger patch, but its size is mostly due to
      a single change for how we check for remapping illegal characters
      in file names - a lot of repeated, small changes to
      the way callers request converting file names.
      
      The final patch in the series does the following:
      
      1) changes default behavior for cifs to be more intuitive.
      Currently we do not map by default to seven reserved characters,
      ie those valid in POSIX but not in NTFS/CIFS/SMB3/Windows,
      unless a mount option (mapchars) is specified.  Change this
      to by default always map and map using the SFM maping
      (like the Mac uses) unless the server negotiates the CIFS Unix
      Extensions (like Samba does when mounting with the cifs protocol)
      when the remapping of the characters is unnecessary.  This should
      help SMB3 mounts in particular since Samba will likely be
      able to implement this mapping with its new "vfs_fruit" module
      as it will be doing for the Mac.
      2) if the user specifies the existing "mapchars" mount option then
      use the "SFU" (Microsoft Services for Unix, SUA) style mapping of
      the seven characters instead.
      3) if the user specifies "nomapposix" then disable SFM/MAC style mapping
      (so no character remapping would be used unless the user specifies
      "mapchars" on mount as well, as above).
      4) change all the places in the code that check for the superblock
      flag on the mount which is set by mapchars and passed in on all
      path based operation and change it to use a small function call
      instead to set the mapping type properly (and check for the
      mapping type in the cifs unicode functions)
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      2baa2682
    • Steve French's avatar
      Allow conversion of characters in Mac remap range (part 2) · a4153cb1
      Steve French authored
      The previous patch allowed remapping reserved characters from directory
      listenings, this patch adds conversion the other direction, allowing
      opening of files with any of the seven reserved characters.
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: default avatarShirish Pargaonkar <shirishpargaonkar@gmail.com>
      a4153cb1
    • Steve French's avatar
      Allow conversion of characters in Mac remap range. Part 1 · b693855f
      Steve French authored
      This allows directory listings to Mac to display filenames
      correctly which have been created with illegal (to Windows)
      characters in their filename. It does not allow
      converting the other direction yet ie opening files with
      these characters (followon patch).
      
      There are seven reserved characters that need to be remapped when
      mounting to Windows, Mac (or any server without Unix Extensions) which
      are valid in POSIX but not in the other OS.
      
      : \ < > ? * |
      
      We used the normal UCS-2 remap range for this in order to convert this
      to/from UTF8 as did Windows Services for Unix (basically add 0xF000 to
      any of the 7 reserved characters), at least when the "mapchars" mount
      option was specified.
      
      Mac used a very slightly different "Services for Mac" remap range
      0xF021 through 0xF027.  The attached patch allows cifs.ko (the kernel
      client) to read directories on macs containing files with these
      characters and display their names properly.  In theory this even
      might be useful on mounts to Samba when the vfs_catia or new
      "vfs_fruit" module is loaded.
      
      Currently the 7 reserved characters look very strange in directory
      listings from cifs.ko to Mac server.  This patch allows these file
      name characters to be read (requires specifying mapchars on mount).
      
      Two additional changes are needed:
      1) Make it more automatic: a way of detecting enough info so that
      we know to try to always remap these characters or not. Various
      have suggested that the SFM approach be made the default when
      the server does not support POSIX Unix extensions (cifs mounts
      to Samba for example) so need to make SFM remapping the default
      unless mapchars (SFU style mapping) specified on mount or no
      mapping explicitly requested or no mapping needed (cifs mounts to Samba).
      
      2) Adding a patch to map the characters the other direction
      (ie UTF-8 to UCS-2 on open).  This patch does it for translating
      readdir entries (ie UCS-2 to UTF-8)
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: default avatarShirish Pargaonkar <shirishpargaonkar@gmail.com>
      b693855f
    • Steve French's avatar
      mfsymlinks support for SMB2.1/SMB3. Part 2 query symlink · c22870ea
      Steve French authored
      Adds support on SMB2.1 and SMB3 mounts for emulation of symlinks
      via the "Minshall/French" symlink format already used for cifs
      mounts when mfsymlinks mount option is used (and also used by Apple).
        http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks
      This second patch adds support to query them (recognize them as symlinks
      and read them).  Third version of patch makes minor corrections
      to error handling.
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Reviewed-by: default avatarStefan Metzmacher <metze@samba.org>
      c22870ea
    • Steve French's avatar
      Add mfsymlinks support for SMB2.1/SMB3. Part 1 create symlink · 5ab97578
      Steve French authored
      Adds support on SMB2.1 and SMB3 mounts for emulation of symlinks
      via the "Minshall/French" symlink format already used for cifs
      mounts when mfsymlinks mount option is used (and also used by Apple).
      http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks
      This first patch adds support to create them.  The next patch will
      add support for recognizing them and reading them.  Although CIFS/SMB3
      have other types of symlinks, in the many use cases they aren't
      practical (e.g. either require cifs only mounts with unix extensions
      to Samba, or require the user to be Administrator to Windows for SMB3).
      This also helps enable running additional xfstests over SMB3 (since some
      xfstests directly or indirectly require symlink support).
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      CC: Stefan Metzmacher <metze@samba.org>
      5ab97578
    • Steve French's avatar
      Allow mknod and mkfifo on SMB2/SMB3 mounts · db8b631d
      Steve French authored
      The "sfu" mount option did not work on SMB2/SMB3 mounts.
      With these changes when the "sfu" mount option is passed in
      on an smb2/smb2.1/smb3 mount the client can emulate (and
      recognize) fifo and device (character and device files).
      
      In addition the "sfu" mount option should not conflict
      with "mfsymlinks" (symlink emulation) as we will never
      create "sfu" style symlinks, but using "sfu" mount option
      will allow us to recognize existing symlinks, created with
      Microsoft "Services for Unix" (SFU and SUA).
      
      To enable the "sfu" mount option for SMB2/SMB3 the calling
      syntax of the generic cifs/smb2/smb3 sync_read and sync_write
      protocol dependent function needed to be changed (we
      don't have a file struct in all cases), but this actually
      ended up simplifying the code a little.
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      db8b631d
    • Steve French's avatar
    • Anton Altaparmakov's avatar
      NTFS: Bump version to 2.1.31. · 3569b70c
      Anton Altaparmakov authored
      Signed-off-by: default avatarAnton Altaparmakov <anton@tuxera.com>
      3569b70c
    • Anton Altaparmakov's avatar
    • Anton Altaparmakov's avatar
      NTFS: Split ntfs_aops into ntfs_normal_aops and ntfs_compressed_aops · ce1bafa0
      Anton Altaparmakov authored
      in preparation for them diverging.
      Signed-off-by: default avatarAnton Altaparmakov <anton@tuxera.com>
      ce1bafa0
  8. 15 Oct, 2014 1 commit
    • Valdis Kletnieks's avatar
      pstore: Fix duplicate {console,ftrace}-efi entries · d4bf205d
      Valdis Kletnieks authored
      The pstore filesystem still creates duplicate filename/inode pairs for
      some pstore types.  Add the id to the filename to prevent that.
      
      Before patch:
      
      [/sys/fs/pstore] ls -li
      total 0
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      1250 -r--r--r--. 1 root root 67 Sep 29 17:09 console-efi
      
      After:
      
      [/sys/fs/pstore] ls -li
      total 0
      1232 -r--r--r--. 1 root root 148 Sep 29 17:09 console-efi-141202499100000
      1231 -r--r--r--. 1 root root  67 Sep 29 17:09 console-efi-141202499200000
      1230 -r--r--r--. 1 root root 148 Sep 29 17:44 console-efi-141202705400000
      1229 -r--r--r--. 1 root root  67 Sep 29 17:44 console-efi-141202705500000
      1228 -r--r--r--. 1 root root  67 Sep 29 20:42 console-efi-141203772600000
      1227 -r--r--r--. 1 root root 148 Sep 29 23:42 console-efi-141204854900000
      1226 -r--r--r--. 1 root root  67 Sep 29 23:42 console-efi-141204855000000
      1225 -r--r--r--. 1 root root 148 Sep 29 23:59 console-efi-141204954200000
      1224 -r--r--r--. 1 root root  67 Sep 29 23:59 console-efi-141204954400000
      Signed-off-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: stable@vger.kernel.org # 3.6+
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      d4bf205d
  9. 14 Oct, 2014 4 commits