From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 8F9706FC86; Mon, 22 Mar 2021 10:20:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8F9706FC86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616397601; bh=BegqymcEMZX+Z8e9evuPE/XjJFFtuvKp/TEMVUH7klA=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Jm5/gtnHHHvhOnh3+SxT7FmFsS6ALLjtPrDmYZfj8t8InYKIWVlaciHvo1IX2Iit7 Vqas3N+5u90G1cTe5xpmu6fSz2qo2W4JMOUdy/dEzXIoqzfPT5nh66I3YuixwOkgcP xbwtgr65abTsCQtCsAMF4NNc+Q6mDlqmlN+VG04Q= Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 65D466FC86 for ; Mon, 22 Mar 2021 10:19:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 65D466FC86 Received: by mail-lf1-f50.google.com with SMTP id q29so19488577lfb.4 for ; Mon, 22 Mar 2021 00:19:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rAtUIUxU86KZLd844Kknt4fz1lWiFpgIdelx2zep2qc=; b=hs885TSs+LaRZVD6BWvX403uB4dxEFWOiSTApFeapIc5UNZtcWFqEYnhgn5+4/tCgg 838eil+oPrYlaEEDgqbk67FnteEONxNozKJ9AlqT7eUQCSmssYj5i4Y/g2zYimXOTKRP eRAz8YGXyHM+9wXnbMgvNguLC91d7kC2MxywEN4s6e0m1/wkvlpaeI5Ig+RprsJY9sMj ZofXR80m7YQzqsUF34YmL/AW7Z3tdHycQfRobJaOYkOQBqB+cdkihX8M2tzsRO0JTUVG 1mYqnDIke2N6y0bBtnXvfkAjQ9/EkzemKxTJqTyVX2HDCtLQUbXHfe28IMd+YZiGEmTr lKVA== X-Gm-Message-State: AOAM530vejFkWWuKOaQAWZXI7oRbxqSWPmijtgmmbjko3LfB/7q++5X7 euvscSppkYGVTnaIcFqkbciJ/uPzyz8= X-Google-Smtp-Source: ABdhPJwgCE2NwH6cnAaSGugna8Z8auKCVvN+/cQE7TK6meKFKF7r+bm0xuc9xh5NI5Hw3bFMNOyHJw== X-Received: by 2002:a05:6512:1105:: with SMTP id l5mr8701454lfg.431.1616397598163; Mon, 22 Mar 2021 00:19:58 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id k11sm1833702ljg.119.2021.03.22.00.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 00:19:57 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 4E276560181; Mon, 22 Mar 2021 10:19:56 +0300 (MSK) Date: Mon, 22 Mar 2021 10:19:56 +0300 To: Vladislav Shpilevoy Message-ID: References: <72141a12d0ea2cca70563695c9e32890f1b9dc0d.1616200860.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72141a12d0ea2cca70563695c9e32890f1b9dc0d.1616200860.git.v.shpilevoy@tarantool.org> User-Agent: Mutt/2.0.5 (2021-01-21) Subject: Re: [Tarantool-patches] [PATCH 01/16] fio: don't use shared buffer in pread() X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Sat, Mar 20, 2021 at 01:42:31AM +0100, Vladislav Shpilevoy wrote: > fio:pread() used buffer.IBUF_SHARED, which might be reused after a > yield. As a result, if pread() was called from 2 different fibers > or in parallel with something else using IBUF_SHARED, it would > turn the buffer into garbage for all parallel usages. > > The same problem existed for read(), and was fixed in > c7c24f841322528c17714482d150b769d0afcddb ("fio: Fix race condition > in fio.read"). But apparently pread() was missed. > > What is worse, the original commit's test passed even without the > fix from that commit. Because it didn't check the results of > read()s called from 2 fibers. > > The patch fixes pread() and adds a test covering both read() and > pread(). The old test from the original commit is dropped. Ack as obvious