mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 02:19:54 +00:00
NFSD: fix leaked reference count of nfsd4_ssc_umount_item
The reference count of nfsd4_ssc_umount_item is not decremented
on error conditions. This prevents the laundromat from unmounting
the vfsmount of the source file.
This patch decrements the reference count of nfsd4_ssc_umount_item
on error.
Fixes: f4e44b3933 ("NFSD: delay unmount source's export after inter-server copy completed.")
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
@@ -1813,13 +1813,17 @@ out:
|
|||||||
release_copy_files(copy);
|
release_copy_files(copy);
|
||||||
return status;
|
return status;
|
||||||
out_err:
|
out_err:
|
||||||
|
if (nfsd4_ssc_is_inter(copy)) {
|
||||||
|
/*
|
||||||
|
* Source's vfsmount of inter-copy will be unmounted
|
||||||
|
* by the laundromat. Use copy instead of async_copy
|
||||||
|
* since async_copy->ss_nsui might not be set yet.
|
||||||
|
*/
|
||||||
|
refcount_dec(©->ss_nsui->nsui_refcnt);
|
||||||
|
}
|
||||||
if (async_copy)
|
if (async_copy)
|
||||||
cleanup_async_copy(async_copy);
|
cleanup_async_copy(async_copy);
|
||||||
status = nfserrno(-ENOMEM);
|
status = nfserrno(-ENOMEM);
|
||||||
/*
|
|
||||||
* source's vfsmount of inter-copy will be unmounted
|
|
||||||
* by the laundromat
|
|
||||||
*/
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user