Jeff Layton 15a8b55dbb nfsd: call op_release, even when op_func returns an error
For ops with "trivial" replies, nfsd4_encode_operation will shortcut
most of the encoding work and skip to just marshalling up the status.
One of the things it skips is calling op_release. This could cause a
memory leak in the layoutget codepath if there is an error at an
inopportune time.

Have the compound processing engine always call op_release, even when
op_func sets an error in op->status. With this change, we also need
nfsd4_block_get_device_info_scsi to set the gd_device pointer to NULL
on error to avoid a double free.

Reported-by: Zhi Li <yieli@redhat.com>
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2181403
Fixes: 34b1744c91cc ("nfsd4: define ->op_release for compound ops")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2023-03-31 17:29:49 -04:00
..
2021-12-03 18:44:06 +01:00
2022-11-28 12:54:44 -05:00
2023-03-10 09:38:47 -05:00
2021-10-02 15:51:10 -04:00
2022-09-26 14:02:47 -04:00
2022-10-20 10:13:27 +02:00
2022-12-19 09:10:33 -06:00
2022-11-28 12:54:44 -05:00
2022-10-06 17:13:18 -07:00
2023-02-20 09:20:59 -05:00
2022-09-26 14:02:47 -04:00
2021-12-13 13:42:51 -05:00
2023-02-20 09:20:21 -05:00