sparc64: Ignored DAX ref count causes lockup
Orabug:
25870705
The dax_mm structure has a reference count that respresents
the number of dax_vma structures that point to it. The reference
count is duly incremented and decremented each time memory is
allocated via the dax_alloc/mmap path. However, the reference
count is never used for its intended purpose, which is to
prevent the dax_mm structure from being freed while there
are references to it. The result of this is that if dax_free
is called after the process's dax_mm is cleaned up, the dax_vma
will have a reference to the freed object, leading to panics
due to null pointers and/or lockups due to inalid spinlock state.
Code changed to actually check the reference count before freeing
a dax_mm.
Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
Reviewed-by: Sanath Kumar <sanath.s.kumar@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>