Skip to content
Snippets Groups Projects
  1. Jan 09, 2014
    • Raphael S. Carvalho's avatar
      zfs: Fix on-disk data inconsistency on shutdown · 2d93af3b
      Raphael S. Carvalho authored
      
      This problem was found when running 'tests/tst-zfs-mount.so' multiple times.
      At the first time, all tests succeed, however, a subsequent run would
      fail at the test: 'mkdir /foo/bar', the error message reported
      that the target file already exists.
      
      The test basically creates a directory /foo/bar, rename it to /foo/bar2,
      then remove /foo/bar2. How could /foo/bar still be there?
      
      Quite simple. Our shutdown function calls unmount_rootfs() which will
      attempt to unmount zfs with the flag MNT_FOURCE, however, it's not being
      passed to zfs_unmount(), neither unmount_rootfs() tests itself the
      return status (which was always getting failures previously).
      So OSv is really being shutdown while there is remaining data waiting to
      be synced with the backing store. As a result, inconsitency.
      
      This problem was fixed by passing the flag to VFS_UNMOUNT which will now
      unmount the fs properly on sudden shutdowns.
      
      Signed-off-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      2d93af3b
  2. Jan 03, 2014
    • Raphael S. Carvalho's avatar
      vfs: change the approach of releasing dentries during unmount · af466dbc
      Raphael S. Carvalho authored
      
      Currently, vflush is used in the unmount process to release remaining
      dentries. vflush in turn calls vevict that is releasing dentries that
      it doesn't own.
      This behavior is not correct neither good to the future of VFS.
      
      So Avi suggested switching to a different approach. We could only
      release those dentries owned by the mountpoint when unmounting it as
      there wouldn't be anything else in the dcache (given its functionality).
      
      The problem was fixed by doing the following steps:
       - Drop vflush calls in sys_umount2, make vevict an empty function,
      and remove vevict.
      
       - Created the function release_mp_dentries to release dentries of a mount
      point which will be called by VFS_UNMOUNT. It cannot be called before
      VFS_UNMOUNT as failures must be considered, neither after as the mount point
      would be considered busy.
      Don't respect this "rule", and that previously seen ZFS replay transaction
      error would happen.
      
      NOTE: vflush is currently duplicated in zfs unmount cases to address the problem
      above. This patch fixes this duplication as well.
      
      Signed-off-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      af466dbc
  3. Dec 10, 2013
    • Raphael S. Carvalho's avatar
      vfs: Fix duplicate in-memory vnodes · 9ecda822
      Raphael S. Carvalho authored
      
      Currently, namei() does vget() unconditionally if no dentry is found.
      This is wrong because the path can be a hard link that points to a vnode
      that's already in memory.
      
      To fix the problem:
      
        - Use inode number as part of the hash in vget()
      
        - Use vn_lookup() in vget() to make sure we have one vnode in memory
          per inode number.
      
        - Push the vget() calls down to individual filesystems and make
          VOP_LOOKUP return an vnode
      
      Changes since v2:
        - v1 dropped lock in vn_lookup, thus assert that vnode_lock is held.
      
      Changes since v3:
        - Fix lock ordering issue in dentry_lookup. The lock respective to the parent
      node must be acquired before dentry_lookup and released after the process is
      done. Otherwise, a second thread looking up for the same dentry may take the
      'NULL' path incorrectly.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      Signed-off-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      9ecda822
  4. Dec 09, 2013
  5. Dec 08, 2013
  6. Dec 03, 2013
  7. Dec 01, 2013
  8. Nov 26, 2013
  9. Nov 19, 2013
  10. Nov 15, 2013
  11. Oct 24, 2013
    • Tomasz Grabiec's avatar
      ramfs: fix use-after-free when ranaming files · 858a2289
      Tomasz Grabiec authored
      
      This happens when you move a file to a different directory.
      
      Thread 2 (Thread 2):
       1  0x000000000032ed3b in halt_no_interrupts ()
         at ../../arch/x64/processor.hh:239
         osv::halt () at ../../core/power.cc:28
       2  0x000000000020e7fe in abort (
          msg=msg@entry=0x580160 "page fault outside application")
          at ../../runtime.cc:109
       3  0x00000000002ecfdc in page_fault (ef=0xffffc0003e362008)
          at ../../core/mmu.cc:981
       4  <signal handler called>
       5  merge (b=0xffffc0003b4e8000, a=0xfffffffffffffff8)
          at ../../core/mempool.cc:421
       6  memory::free_page_range_locked (range=range@entry=0xffffc0003b4e8000)
          at ../../core/mempool.cc:436
       7  0x00000000003186d7 in memory::free_page_range (
          range=range@entry=0xffffc0003b4e8000) at ../../core/mempool.cc:448
       8  0x0000000000319280 in free_large (obj=0xffffc0003b4e9000)
          at ../../core/mempool.cc:460
       9  std_free (object=0xffffc0003b4e9000) at ../../core/mempool.cc:790
       10 free (obj=0xffffc0003b4e9000) at ../../core/mempool.cc:892
       11 0x0000000000340e52 in ramfs_free_node (np=np@entry=0xffffc0003d250d40)
          at ../../fs/ramfs/ramfs_vnops.c:78
       12 0x0000000000340ed2 in ramfs_remove_node (dnp=0xffffc0003d250a00,
          np=0xffffc0003d250d40) at ../../fs/ramfs/ramfs_vnops.c:131
       13 0x0000000000340ffd in ramfs_rename (dvp1=0xffffc0003fc9a180,
          vp1=0xffffc0003fc9a100, name1=<optimized out>, dvp2=0xffffc0003fc9a280,
          vp2=<optimized out>, name2=0x2000001fedf1 "prefix_suffix")
          at ../../fs/ramfs/ramfs_vnops.c:380
       14 0x0000000000340069 in sys_rename (src=<optimized out>,
          dest=<optimized out>) at ../../fs/vfs/vfs_syscalls.c:671
       15 0x000000000033a3b2 in rename (oldpath=<optimized out>,
          newpath=0xffffc0003e858cc0 "/tmp/t3-26e1b47c/prefix_suffix")
          at ../../fs/vfs/main.cc:634
      
      Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
      858a2289
  12. Oct 17, 2013
  13. Sep 26, 2013
  14. Aug 16, 2013
    • Christoph Hellwig's avatar
      vfs: split dentries from vnodes · 85dda0a8
      Christoph Hellwig authored
      Create a new dentry structure for pathname components, following the Linux
      VFS model.  The vnodes are left-as is for now but are always fronted by
      dentries for pathname lookups.  In a second step they will be moved to
      use non-pathname indices.
      
      [penberg: fix open(O_CREAT|O_EXCL) breakage ]
      85dda0a8
  15. May 24, 2013
  16. Feb 12, 2013
  17. Feb 05, 2013
  18. Jan 28, 2013
    • Christoph Hellwig's avatar
      move filesystem related headers to include/ · 1c08a4b8
      Christoph Hellwig authored
      I've also added an osv/ prefix to make sure we don't clash with system headers.
      
      We probably should either adopt this globally or drop it, but I fear we'll run into
      problems with the latter approach.
      1c08a4b8
  19. Jan 19, 2013
    • Christoph Hellwig's avatar
      uio-ify the read/write path · 5e90d3ab
      Christoph Hellwig authored
      This will allow for easy addition of the vectored and positional I/O
      syscalls, as well as making the structure of the I/O path more similar
      to *BSD and Solaris.
      5e90d3ab
  20. Jan 10, 2013
Loading