1. 05 7月, 2017 19 次提交
  2. 28 6月, 2017 2 次提交
  3. 05 6月, 2017 2 次提交
  4. 29 5月, 2017 2 次提交
    • M
      ovl: filter trusted xattr for non-admin · a082c6f6
      Miklos Szeredi 提交于
      Filesystems filter out extended attributes in the "trusted." domain for
      unprivlieged callers.
      
      Overlay calls underlying filesystem's method with elevated privs, so need
      to do the filtering in overlayfs too.
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      a082c6f6
    • A
      ovl: mark upper merge dir with type origin entries "impure" · f3a15685
      Amir Goldstein 提交于
      An upper dir is marked "impure" to let ovl_iterate() know that this
      directory may contain non pure upper entries whose d_ino may need to be
      read from the origin inode.
      
      We already mark a non-merge dir "impure" when moving a non-pure child
      entry inside it, to let ovl_iterate() know not to iterate the non-merge
      dir directly.
      
      Mark also a merge dir "impure" when moving a non-pure child entry inside
      it and when copying up a child entry inside it.
      
      This can be used to optimize ovl_iterate() to perform a "pure merge" of
      upper and lower directories, merging the content of the directories,
      without having to read d_ino from origin inodes.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      f3a15685
  5. 19 5月, 2017 3 次提交
  6. 18 5月, 2017 3 次提交
  7. 15 5月, 2017 1 次提交
    • A
      ovl: select EXPORTFS · 72d42504
      Arnd Bergmann 提交于
      We get a link error when EXPORTFS is not enabled:
      
      ERROR: "exportfs_encode_fh" [fs/overlayfs/overlay.ko] undefined!
      ERROR: "exportfs_decode_fh" [fs/overlayfs/overlay.ko] undefined!
      
      This adds a Kconfig 'select' statement for overlayfs, the same way that
      it is done for the other users of exportfs.
      
      Fixes: 3a1e819b ("ovl: store file handle of lower inode on copy up")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      72d42504
  8. 05 5月, 2017 8 次提交
    • A
      ovl: persistent inode numbers for upper hardlinks · 5b6c9053
      Amir Goldstein 提交于
      An upper type non directory dentry that is a copy up target
      should have a reference to its lower copy up origin.
      
      There are three ways for an upper type dentry to be instantiated:
      1. A lower type dentry that is being copied up
      2. An entry that is found in upper dir by ovl_lookup()
      3. A negative dentry is hardlinked to an upper type dentry
      
      In the first case, the lower reference is set before copy up.
      In the second case, the lower reference is found by ovl_lookup().
      In the last case of hardlinked upper dentry, it is not easy to
      update the lower reference of the negative dentry.  Instead,
      drop the newly hardlinked negative dentry from dcache and let
      the next access call ovl_lookup() to find its lower reference.
      
      This makes sure that the inode number reported by stat(2) after
      the hardlink is created is the same inode number that will be
      reported by stat(2) after mount cycle, which is the inode number
      of the lower copy up origin of the hardlink source.
      
      NOTE that this does not fix breaking of lower hardlinks on copy
      up, but only fixes the case of lower nlink == 1, whose upper copy
      up inode is hardlinked in upper dir.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      5b6c9053
    • M
      ovl: merge getattr for dir and nondir · 5b712091
      Miklos Szeredi 提交于
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      5b712091
    • A
      ovl: constant st_ino/st_dev across copy up · 72b608f0
      Amir Goldstein 提交于
      When all layers are on the same underlying filesystem, let stat(2) return
      st_dev/st_ino values of the copy up origin inode if it is known.
      
      This results in constant st_ino/st_dev representation of files in an
      overlay mount before and after copy up.
      
      When the underlying filesystem support NFS exportfs, the result is also
      persistent st_ino/st_dev representation before and after mount cycle.
      
      Lower hardlinks are broken on copy up to different upper files, so we
      cannot use the lower origin st_ino for those different files, even for the
      same fs case.
      
      When all overlay layers are on the same fs, use overlay st_dev for non-dirs
      to get the correct result from du -x.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      72b608f0
    • A
      ovl: persistent inode number for directories · b7a807dc
      Amir Goldstein 提交于
      stat(2) on overlay directories reports the overlay temp inode
      number, which is constant across copy up, but is not persistent.
      
      When all layers are on the same fs, report the copy up origin inode
      number for directories.
      
      This inode number is persistent, unique across the overlay mount and
      constant across copy up.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      b7a807dc
    • A
      ovl: set the ORIGIN type flag · 59548503
      Amir Goldstein 提交于
      For directory entries, non zero oe->numlower implies OVL_TYPE_MERGE.
      Define a new type flag OVL_TYPE_ORIGIN to indicate that an entry holds a
      reference to its lower copy up origin.
      
      For directory entries ORIGIN := MERGE && UPPER. For non-dir entries ORIGIN
      means that a lower type dentry has been recently copied up or that we were
      able to find the copy up origin from overlay.origin xattr.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      59548503
    • A
      ovl: lookup non-dir copy-up-origin by file handle · a9d01957
      Amir Goldstein 提交于
      If overlay.origin xattr is found on a non-dir upper inode try to get lower
      dentry by calling exportfs_decode_fh().
      
      On failure to lookup by file handle to lower layer, do not lookup the copy
      up origin by name, because the lower found by name could be another file in
      case the upper file was renamed.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      a9d01957
    • A
      c22205d0
    • A
      ovl: store file handle of lower inode on copy up · 3a1e819b
      Amir Goldstein 提交于
      Sometimes it is interesting to know if an upper file is pure upper or a
      copy up target, and if it is a copy up target, it may be interesting to
      find the copy up origin.
      
      This will be used to preserve lower inode numbers across copy up.
      
      Store the lower inode file handle in upper inode extended attribute
      overlay.origin on copy up to use it later for these cases.  Store the lower
      filesystem uuid along side the file handle, so we can validate that we are
      looking for the origin file in the original fs.
      
      If lower fs does not support NFS export ops store a zero sized xattr so we
      can always use the overlay.origin xattr to distinguish between a copy up
      and a pure upper inode.
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      3a1e819b