[Devel] [PATCH RHEL7 COMMIT] fuse kio: Reorder callback assignment

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 16 18:04:32 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.9
------>
commit 7dd52de01c62123408c1756fba42d6ca0fa58dc7
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Oct 16 18:04:30 2018 +0300

    fuse kio: Reorder callback assignment
    
    This is just refactoring
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Reviewed-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
    
    =====================
    Patchset description:
    
    Order pcs_rpc and pcs_sockio destruction and close leaked socket
    
    https://pmc.acronis.com/browse/VSTOR-15305
    
    Ploop can asynchronously unmap regions by sending IOCB_CMD_UNMAP_ITER, but this
    command isn't quite correctly interpreted in Fuse. Moreover, in Fast-path mode,
    fallocate(FALLOC_FL_PUNCH_HOLE|FALLOC_FL_ZERO_RANGE) falls to fuse user daemon
    and it can lead to data corruption.
    
    Let's fix it.
    
    Kirill Tkhai (9):
          fuse kio: Use __maybe_unused
          fuse kio: Use sio eof instead of parent to determ abort
          fuse kio: Reorder callback assignment
          fuse kio: Add pcs_cleanup_wq
          fuse kio: Destroy rpc in work func
          fuse kio: Introduce pcs_sk_kick_queue()
          fuse kio: Dereference sk_user_data under rcu
          fuse kio: Fix rpc socket leak on rpc_abort()
          fuse kio: Hold pcs_rpc counter till sio may be freed
---
 fs/fuse/kio/pcs/pcs_sock_io.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_sock_io.c b/fs/fuse/kio/pcs/pcs_sock_io.c
index 18b66f99e018..44c49b63f5d1 100644
--- a/fs/fuse/kio/pcs/pcs_sock_io.c
+++ b/fs/fuse/kio/pcs/pcs_sock_io.c
@@ -555,18 +555,18 @@ struct pcs_sockio * pcs_sockio_init(struct socket *sock,
 	sio->ioconn.orig.error_report = sk->sk_error_report;
 	//sio->ioconn.orig_state_change = sk->sk_state_change;
 
-	sk->sk_user_data = sio;
-	sk->sk_data_ready = pcs_sk_data_ready;
-	sk->sk_write_space = pcs_sk_write_space;
-	sk->sk_error_report = pcs_sk_error_report;
-	sk->sk_allocation = GFP_NOFS;
-
 	//sock->sk->sk_state_change = pcs_state_chage;
 
 	sk->sk_sndtimeo = PCS_SIO_TIMEOUT;
+	sk->sk_allocation = GFP_NOFS;
 	sio->send_timeout = PCS_SIO_TIMEOUT;
 	sio->ioconn.socket = sock;
 	sio->ioconn.destruct = pcs_sock_ioconn_destruct;
+
+	sk->sk_user_data = sio;
+	sk->sk_data_ready = pcs_sk_data_ready;
+	sk->sk_write_space = pcs_sk_write_space;
+	sk->sk_error_report = pcs_sk_error_report;
 	write_unlock_bh(&sock->sk->sk_callback_lock);
 
 	pcs_clear_error(&sio->error);



More information about the Devel mailing list