Skip to content
Snippets Groups Projects
  1. 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
    • Nadav Har'El's avatar
      Fix wrong error codes in unlink(), rmdir() and readdir() · 86b5374f
      Nadav Har'El authored
      
      This patch fixes the error codes in four error cases:
      
      1. unlink() of a directory used to return EPERM (as in Posix), and now
         returns EISDIR (as in Linux).
      
      2. rmdir() of a non-empty directory used to return EEXIST (as in Posix)
         and now returns ENOTEMPTY (as in Linux).
      
      3. rmdir() of a regular file (non-directory) used to return EBADF
         and now returns ENOTDIR (as in Linux).
      
      4. readdir() of a regular file (non-directory) used to return EBADF
         and now returns ENOTDIR (as in Linux).
      
      This patch also adds a test, tst-remove.cc, for the various unlink() and
      rmdir() success and failure modes.
      
      Fixes #123.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      86b5374f
  2. Dec 09, 2013
  3. Dec 08, 2013
  4. Dec 05, 2013
  5. Dec 04, 2013
  6. Dec 03, 2013
  7. Dec 02, 2013
  8. Dec 01, 2013
  9. Nov 28, 2013
  10. Nov 27, 2013
  11. Nov 26, 2013
  12. Nov 11, 2013
  13. Nov 08, 2013
  14. Nov 01, 2013
  15. Oct 28, 2013
    • Pekka Enberg's avatar
      bsd: Fix printf format string · 55542075
      Pekka Enberg authored
      
      Spotted by GCC with '-Wformat=1':
      
      ../../bsd/sys/netinet/tcp_subr.c: In function ‘tcp_log_addr’:
      ../../bsd/sys/netinet/tcp_subr.c:2286:3: warning: unknown conversion type character ‘b’ in format [-Wformat=]
         sprintf(sp, " tcpflags 0x%b", th->th_flags, PRINT_TH_FLAGS);
         ^
      ../../bsd/sys/netinet/tcp_subr.c:2286:3: warning: too many arguments for format [-Wformat-extra-args]
      
      BSD has some nice printf extension for printing out bitfields. We don't
      so switch to hexadecimal output.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      55542075
  16. Oct 24, 2013
  17. Oct 23, 2013
  18. Oct 22, 2013
    • Tomasz Grabiec's avatar
      Fix make mode=debug build · b440bfe6
      Tomasz Grabiec authored
      
      When building with -O0 we get:
      
       bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.o: In
       function `zfs_ioc_destroy_snaps_nvl':
       (...)/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c:3265:
       undefined reference to `zvol_remove_minor'
      
      Looks like the problem is that the missing symbol,
      `zvol_remove_minor', referenced from zfs_ioctl.o is not in the zvol.o
      because it's not defined, because it is inside '#ifdef NOTYET' block
      (which is off). It works in the normal build because when compiled
      with -O2 (and even with -O1), the reference to zvol_remove_minor in
      zfs_ioctl.c is optimized away.
      
      This patch puts the block using zvol_remove_minor also inside '#ifdef
      NOTYET' to be consistent.
      
      Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
      b440bfe6
Loading