HomeFreeBSD

Ensure we call fput when cloning fails due to different devices.

Description

Ensure we call fput when cloning fails due to different devices.

Right now, zpl_ioctl_ficlone and zpl_ioctl_ficlonerange do not call
put on the src fd if the source and destination are on two different
devices. This leaves the source file held open in this case.

Reviewed-by: Kay Pedersen <mail@mkwg.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
Closes #15386

Details

Provenance
Daniel Berlin <dberlin@dberlin.org>Authored on Oct 10 2023, 6:04 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 11 2023, 2:19 AM
Parents
rG75a7740574e1: ZTS: Remove zfs_allow_010_pos expection for FreeBSD
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG810fc49a3eb1: Ensure we call fput when cloning fails due to different devices. (authored by Daniel Berlin <dberlin@dberlin.org>).Oct 11 2023, 2:19 AM