Fix Details
-----------

Problem report (GH Issue) upstream in ZFS on Linux:
        https://github.com/zfsonlinux/zfs/issues/4816 ("Looping in zfs_zget()")

With very similar stack trace (syscall -> shrink -> 
zfs_{inactive/rmnode/purgedir/zget})
        https://github.com/zfsonlinux/zfs/issues/4816#issuecomment-229532796

Proposed patch in the Issue (not the right/final solution):
        https://github.com/zfsonlinux/zfs/issues/4816#issuecomment-229537558
        https://github.com/zfsonlinux/zfs/pull/4822 ("Allow zfs_purgedir() to 
skip inodes undergoing eviction")

However, that proposed patch is not the right/final solution:
        https://github.com/zfsonlinux/zfs/pull/4822#issuecomment-230938382
        https://github.com/zfsonlinux/zfs/pull/4822#issuecomment-232208224

Instead, these proposed patches are actually the right/final solution:
        https://github.com/zfsonlinux/zfs/pull/4827 ("xattr dir doesn't get 
purged during iput")

The two patches are merged upstream:
        https://github.com/zfsonlinux/zfs/pull/4827#issuecomment-232207013

        1) ddae16a xattr dir doesn't get purged during ipu
        2) 31b6111 Kill zp->z_xattr_parent to prevent pinning

Available in the 0.7.0 release:

        $ git describe --contains ddae16a 31b6111
        zfs-0.7.0-rc1~102
        zfs-0.7.0-rc1~101

Thus Ubuntu only needs these patches on Xenial (zfs-linux < 0.7.0):

        $ rmadison zfs-linux
         zfs-linux | 0.6.5.6-0ubuntu8  | xenial/universe | source
         zfs-linux | 0.6.5.6-0ubuntu27 | xenial-updates  | source
         zfs-linux | 0.7.5-1ubuntu15   | bionic          | source
         zfs-linux | 0.7.5-1ubuntu16.6 | bionic-updates  | source
         zfs-linux | 0.7.12-1ubuntu5   | disco           | source
         zfs-linux | 0.8.1-1ubuntu8    | eoan            | source

There's a later commit that changes/"reverts" the 
commit ddae16a ("xattr dir doesn't get purged during ipu"),
but it's not a bug fix, but rather a refactor/feature.

        https://github.com/zfsonlinux/zfs/pull/4838

With commit dfbc86309fd8 (below).

The commit ids are not mentioned in further commits upstream.

        $ git log --oneline --grep ddae16a ddae16a^..origin/master
        dfbc86309fd8 Use native inode->i_nlink instead of znode->z_links

        $ git log --oneline --grep 31b6111 ddae16a^..origin/master
        $

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to zfs-linux in Ubuntu.
https://bugs.launchpad.net/bugs/1839521

Title:
  Xenial: ZFS deadlock in shrinker path with xattrs

Status in zfs-linux package in Ubuntu:
  Invalid
Status in zfs-linux source package in Xenial:
  In Progress
Status in zfs-linux source package in Bionic:
  Invalid
Status in zfs-linux source package in Disco:
  Invalid
Status in zfs-linux source package in Eoan:
  Invalid

Bug description:
  [Impact]

   * Xenial's ZFS can deadlock in the memory shrinker path
     after removing files with extended attributes (xattr).

   * Extended attributes are enabled by default, but are
     _not_ used by default, which reduces the likelyhood.

   * It's very difficult/rare to reproduce this problem,
     due to file/xattr/remove/shrinker/lru order/timing
     circumstances required. (weeks for a reporter user)
     but a synthetic test-case has been found for tests.

  [Test Case]

   * A synthetic reproducer is available for this LP,
     with a few steps to touch/setfattr/rm/drop_caches
     plus a kernel module to massage the disposal list.

   * In the original ZFS module:
     the xattr dir inode is not purged immediately on
     file removal, but possibly purged _two_ shrinker
     invocations later.  This allows for other thread
     started before file remove to call zfs_zget() on
     the xattr child inode and iput() it, so it makes
     to the same disposal list as the xattr dir inode.

   * In the modified ZFS module:
     the xattr dir inode is purged immediately on file
     removal not possibly later on shrinker invocation,
     so the problem window above doesn't exist anymore.

  [Regression Potential]

   * Low. The patches are confined to extended attributes
     in ZFS, specifically node removal/purge, and another
     change how an xattr child inode tracks its xattr dir
     (parent) inode, so that it can be purged immediately
     on removal.

   * The ZFS test-suite has been run on original/modified
     zfs-dkms package/kernel modules, with no regressions.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1839521/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to