Fix cloning into already dirty dbufs.
commitce0e1cc402505493a890e7fc0819e582ae686b3b
authorPawel Jakub Dawidek <pawel@dawidek.net>
Fri, 24 Mar 2023 17:18:35 +0000 (24 18:18 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2023 17:18:35 +0000 (24 10:18 -0700)
tree9d95cbe796e9cd5395d93d333c8a8489eb078a49
parent5b5f518687551b5e245d7515d0c81b174c47acfb
Fix cloning into already dirty dbufs.

Undirty the dbuf and destroy its buffer when cloning into it.

Coverity ID: CID-1535375
Reported-by: Richard Yao
Reported-by: Benjamin Coddington
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14655
include/sys/dbuf.h
module/zfs/dbuf.c
module/zfs/dmu.c