Message ID | 20241030101550.21014-9-stefano.babic@swupdate.org |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBD2ZDGN6SEKRBXEORC4QMGQE72HGYBI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=EdA4VWH8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33d; helo=mail-wm1-x33d.google.com; envelope-from=swupdate+bncbd2zdgn6sekrbxeorc4qmgqe72hgybi@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x33d.google.com (mail-wm1-x33d.google.com [IPv6:2a00:1450:4864:20::33d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xdjh42CJHz1xxd for <incoming@patchwork.ozlabs.org>; Wed, 30 Oct 2024 21:16:03 +1100 (AEDT) Received: by mail-wm1-x33d.google.com with SMTP id 5b1f17b1804b1-43152cd2843sf43264905e9.3 for <incoming@patchwork.ozlabs.org>; Wed, 30 Oct 2024 03:16:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730283359; cv=pass; d=google.com; s=arc-20240605; b=XkufLWoMu6bAoygarhPRkRqBSgK6MlRRd6wkdFqBVbBnSxQTeIbGCO4cBm7cR81F1B IekqTt6A4PTG68UE03HjYyVjL7rjcNTwMe/KEG44dNf00IbhzDYG3V197N3DCPG42TmA OICr2914Y26D5DiqY8g3byB/icHwVnC1Ohxq1JoJoABZc3MSWo+PTNikSE5oGh+45Q12 iCCseSU+/+yh4taHa2HGF8vZSi15Xxa7RNxRJEWFFukno4PSAdn24QfUR6TPHIeHeRFG /+BIEGUf17ywjoHRUKCK+YgrERuXp4VPp42bVYaSFyt/z2TFY8iHVg+kpZCd9Ob7u+Os Xlsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=+iVDffVMqZBFvzd2NWGDBf+cbkcN5kFzasZoXuydlUw=; fh=69tw6czJIRK1MSz9TumyBGYiNyDNXL868aoHDpMA19E=; b=fitk3fxXW41kbmceND4EynHxQzPHA6+Pb3aKMD5F/27EkB8vQMAwzYesc6oMbFXaPq oxygzEOvxxoDjDqDxmApwEUu29QzoWpcz2c8+syxMo+sL3o0tvt9q3e9HwiUgzLHPfxq cZU+iBk6vqrr5ch0oAv+gADKVp22/K0XxAeMQe4vKhS+xRJlngnnCwYhI2tYqeMZg4uq CFIsEqHgx+0CzQy9fmWJ38ytNsOia0DXi3g7BZNAdtYvSSme379xT/G8siBJsKFJtsRG sKJ8sapNEaR9vYaxaqtr/2bE3Mfh+nT21yBvGvAIo+jPBP3ozh+qcoTW3bOu4qoGhxZu /++A==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b="lN/L0MR8"; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1730283359; x=1730888159; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=+iVDffVMqZBFvzd2NWGDBf+cbkcN5kFzasZoXuydlUw=; b=EdA4VWH8wvF6gWZ7GizyWbVfzF8C4nxAog7V/bvp25mcWA4Ztj2Z0eMYr4bzWUb+Qd 4Fu3pqTvieilqMPPJztNfbEHe0mjpAuG6rf5CnPfJ8bvs9+fDtBNNMGxBeNRyZIYTI2f 6OViNMWEZKp/hkCSj6EeaVjTs8B7pjLHUSXJ9jZ9J819d2gQ+ft/s89aA1JlBuHEOkAo 3kNXO+Fcz2JzMrMIaiYK81K89xQfLE7q6DlFXRJL9qomAh5LnjxKdHPGXMuF0n2sP4AK jaa7xPZnuTqXL+KavxJJ1WFmxrnbLdgNOxpQ9PCQN5yeLtisC+o7ARnuVa8wN0HL2D+8 nV/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730283359; x=1730888159; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=+iVDffVMqZBFvzd2NWGDBf+cbkcN5kFzasZoXuydlUw=; b=TpqX9jQJ1Jp8m7DqUaXosfnbs4PcyqUU80S8IGFekAYuJ/qX1C4TcPA/gSOnKIYB1C AMzffLceARpBwXsEYYXswsssaZhI5ZVAk9XbLsUhbE/Q3BwA9SSc2FubZ9KqYp3VF/nd mf6/6bo8dJyDOT7BriQK5ozMDKVoGpTymObMqTWxJKnTx4YAzA3pVo6CPahwAs4d/3eo Ane80vafQ14s21Ve360pN4lpSLtT7Sw5/V7Vol6D0HTMypnIhCPfqL595phcCgKKvYWZ 6XoxSM/WrJZkvt41GcDHSOIxl/odibMJpZu0TnfV5q1drtb//bpYBeRlPP/MfXPAMF+X TzCw== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCW3B7rdKQCugQvD7i7/7j20B7stwPfEXNV89UeRUCTqBLG8lg+kIM2ZEEBcH6WtTf3GtM9PSz8Z6w==@patchwork.ozlabs.org X-Gm-Message-State: AOJu0YzIBeegOW8TOMHbY7sYCfTGKKz+BIuAwNZUQKKNGCdhNTqHiUq7 0x2127+J6rrbI7qzQCTUgiJPadGuz4BPe9zQfZB8zveefFyiud/V X-Google-Smtp-Source: AGHT+IFDB7ahexXRnGFCxis5DfYrD+QwthDjHR1r2eVfKtoIWsEJ3n4sGhTE2eOtWwtvmQjrCNA8zA== X-Received: by 2002:a05:600c:4fd3:b0:431:52b7:a485 with SMTP id 5b1f17b1804b1-431bb98fc9fmr23077465e9.19.1730283358399; Wed, 30 Oct 2024 03:15:58 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:4203:b0:431:9388:1f72 with SMTP id 5b1f17b1804b1-43193882237ls23309935e9.2.-pod-prod-01-eu; Wed, 30 Oct 2024 03:15:55 -0700 (PDT) X-Received: by 2002:a05:600c:3547:b0:42c:b16e:7a22 with SMTP id 5b1f17b1804b1-431bb9855c0mr22706505e9.12.1730283354805; Wed, 30 Oct 2024 03:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730283354; cv=none; d=google.com; s=arc-20240605; b=jyQKLnaWk6LD4JwQ6YbJR4HCD53rZhntwF6TLfYPRJ3L8AZRatYCEpH200ks8wnVfx cf68BbfmZ/RQImSHUHy1lKI1wx2nUY4/MZK7GFNmoljfttSVr+GZAnHSD/IvYGc4dzVz ke3QG2Zm1DZpyiwiaFBXWBKqKhVbRN1L9Dwfim6bjpq4ipr3fr1x2cwyCiP6o79a2iMI gvlsCQ7Z9Q/EaLfGadz5jdw2R22LNgcxICiqZoywLBJsnMBlJkpQ1NUlRhaBqK7i+Giw prQS6Ih/HK+Rg4YrB8+7n0ZwkdBchgYdAmQ06lnjfqVJCrdYFQnU3QrRASk442ltyGB6 eXUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=10QI5Rv+NhkSx6Ag807QrkXdKZFZaABAhRrBGo7pj3I=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=TmNxzIjtKy3Jm6bjtvHiG+HsCdNNbwKbWqboHB4XsL1oLN1VqtqSs9tj413xuj36Ze 5PhemQKzLaO3LHOZPW5Z98uRMS6L8DA+zUCFZUsb/4uMCUAGFX6knPnC6VH3ep0B9QQB l4PKwuBljVb7PDG8G7AWG5Yut46eCUu/FwvxPf1BXLxvuYtnj1n1J67T9/mUVgvbhKzx VF2JflErgPPPwzQUIeKcXNclAUN0C76533H8XR7LeXyLUKdMWOiq2Xs//F5tAcZ31ul2 OWLcnZIAiUOi/emccikmofboqqzu7XxZQoSvbGuXTu5MMINqeu8ZPlC8MGl2/gvRG55F Cnbg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b="lN/L0MR8"; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-431bd718cacsi202345e9.0.2024.10.30.03.15.54 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2024 03:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MmD2M-1tWf8M0wym-00pQ01; Wed, 30 Oct 2024 11:15:54 +0100 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 08/10] BUG: fix data transfer in callback used by docker Date: Wed, 30 Oct 2024 11:15:48 +0100 Message-Id: <20241030101550.21014-9-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241030101550.21014-1-stefano.babic@swupdate.org> References: <20241030101550.21014-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:oXtnD5C3Rvp/9A8BRHhq/nbJiqa82GoA0E3IrDo8RAXbKnyMq5b vOecNZF/d3h9O0X2sNBs/zGtLHhF9MxfbN5NoY7pzYd4mxQyLZVDEipezf+0+Q71427LTLw 2mknLY9jafmrqrq3R92n0cttGFl9FWqLXuOq/CtSVUaA9qNPu7cxhIX+FToNLh8CqNKYC25 OneM6CaLeoA0ckbssoJgw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Pbl7qiYGAUk=;iLV5lalveZk3EfxEQzsZ3Tg+O6w GMekhXpatyRjaULY0dl1Ft5vBmemPmp8mfaDilx7WIAImt2+PVhGz1yjAbKtP0veP5keWP72X G0ibglXnW03jOfNpm62U6h+aznxDpLTnSKCf2tkTlwceuCrPyNDv/Y++lzQ3JodLiE2jjD51T /XcezFAhjVLtW42w+Nfp74PX+0l1xzoyO3dQOfFIwuk58PQ7AxWFzUT7NpB14scVKW1QMuPn4 stKQr7xHx4I5GJ1qL4FX5BbiZ5SOUvysODaISfyIXUoHu53GJ8GusV+1GUJSsXJDNF3FMY6l6 Bkqry74poQhDWnUbusaqSbCwsfDxNnf+DhKi1C/nkuHN1gT9ox7jWFV2GeJHkQDEe4JUoRsEx E9TgDZ04zFGdEQeU2Qxp1KVY3WhAJMtKIe1HnNmQ8vAwoSqiTTrA5wl0iH00xIX3XZOGJUsqK tWDKHIMORG9+NKQkSzEPUpkAW5ARggpgJmRVo32gVYTJmqab5xHeiEMhipepv6Cst2yb9CpuQ S9cAo4zEVpo+CE1bpLP5T5+Yg8tDsUi+UPaq0rPXlDg13KNR5Nhhttsk5zlmGVNwOAZpb59mi UbttFgCD2QpCzV2VBKdDtIIw6WE3EPXTn/MROqWvl/ynjA68PNXpB5ZqYRnxqAtigSaLFmMVy 9HrpeaCqHxkErLBXXQ858d9NFuY1+zigK4M10pmnt/wA5mtbkI4qACMYGxhPB7vjo6mPyfSz6 b5bE7XNO3UY/HWnDZ3in11IQyP8xkDQow== X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b="lN/L0MR8"; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
Introduce BTRFS Snapshot Handler
|
expand
|
diff --git a/handlers/handler_helpers.c b/handlers/handler_helpers.c index 5861690a..a09c2fe4 100644 --- a/handlers/handler_helpers.c +++ b/handlers/handler_helpers.c @@ -28,12 +28,12 @@ int handler_transfer_data(void *data, const void *buf, size_t len) { struct hnd_load_priv *priv = (struct hnd_load_priv *)data; - ssize_t written; unsigned int nbytes = len; - const void *tmp = buf; + const char *tmp = buf; while (nbytes) { - written = write(priv->fifo[FIFO_HND_WRITE], buf, len); + ssize_t written; + written = write(priv->fifo[FIFO_HND_WRITE], tmp, nbytes); if (written < 0) { ERROR ("Cannot write to fifo"); return -EFAULT;
The callback has severe bugs and it works because the write() can be done in a single step. Loop is buggy, and it does not work if multiple write are required to transfer the data. Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- handlers/handler_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.34.1