Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1649930ybh; Mon, 20 Jul 2020 03:54:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrH9WvPt9y6RYUCEDzrXAwXTUkhlnylZFGDT0X7EZpjOOuOouHVA5IivIhoJ7oY+vlENeg X-Received: by 2002:a17:906:54a:: with SMTP id k10mr19789415eja.480.1595242462106; Mon, 20 Jul 2020 03:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595242462; cv=none; d=google.com; s=arc-20160816; b=l7ffZEgAgWNMOVKZnbdY4tIVl0FGbkNd6dmW7QxZbYDlzLaDZYMxdscUaDaUku0CWP tU2qi2vy5olgKGCY0wQN4z80uFWVHwrkAXYHOtIXhIx4mToStHuqGDAMJ3zDitY4oqb+ oVdR9m48KIP/4Tv4aAaPVsPP0VM0ZnucSxd8vCfFJWvntI0xO0XCmJubfjT0K/J79xVO rIi2kLkXDqollDM9Ck6Z4Ui/jzY5Zl67sFqkk9qS6hYihJ7gqxdVf5gyQqU5C3GdeVVq X7Sex+e0MznAo3Ht5G/7bXOZWcj+zbcLGiEpO0GYYi7e+6oTRPODuJaaI95ilSAkw/3Y foJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:dkim-signature; bh=0qEaLy0Hyr3SwuDgUAydri7YBfNLnnwpux/l1PMZrXs=; b=yCcnasyr1YObMyOVYGJOBcnVBu8+vUTuzb2awwftTcSjebFuNr8dbtdvtKMgMDLuTA iaxOCPJpj9eEG2ZZw9NJ9bScHMHmT41OVn8fadRy8Xpq+Amq+1l74O9q7YcfLYA7zuuC PGMXfEivsmY5eKPKC3eQY4c//NhzH+wMx/6D75H8Xs+8hc0OsC2YxnTKy5ddiSsY9MmR BLr20CfoBBbjCde4t85w22jpSWAlvqY6/wPgV5A0FRHWeap7FHKwEPonY+KqWKCpplLO CuShH2kyAiLm+9XTyNq48qLw41cu7Fem+UNzpTaGT+6gv+hZYObdepyvYi0slqoTXXpU WkUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DfbfY0OC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq21si10158368edb.353.2020.07.20.03.53.58; Mon, 20 Jul 2020 03:54:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DfbfY0OC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728430AbgGTKxJ (ORCPT + 99 others); Mon, 20 Jul 2020 06:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728348AbgGTKxI (ORCPT ); Mon, 20 Jul 2020 06:53:08 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE20CC061794; Mon, 20 Jul 2020 03:53:08 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id p3so10137845pgh.3; Mon, 20 Jul 2020 03:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0qEaLy0Hyr3SwuDgUAydri7YBfNLnnwpux/l1PMZrXs=; b=DfbfY0OClpMHAFSaP+f9tqbmvr533JaX4bNcruO+IiubyumIIzF+ZR7evBBXjmuleh R0y0HxshhdySi25YF8SHlPQj7zmSWAFkOKx8mRVYCtJyJKV0U8uGKQMDI+mM6CX2w5+4 anzvsNc8DC07lf+jLdDPHBl0IgiIuP7vuYGDkfIRY3kSaTCyPxv/1knuqiQlFm7rzisM 1mOuwxynMQKshI3u02qIbMOgyrLi2cQInAdG/nxy8kNET2ktdBZ0CRpK7HTLrisYD/Kt Cmfl8sl+grmeBz3BLzBBu7xYzx1v0wgkdSQdeIZTua85gRztILnYxuw+ULo1+dIy+7Wk E6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0qEaLy0Hyr3SwuDgUAydri7YBfNLnnwpux/l1PMZrXs=; b=DHuSQonZ8vMoj6k7LqrTrgw9/zMjj6LM9ZbAYfFpzykwUe1wCi3CUsbuTAEvarhPGX Nsvb8oDdfGagFCFqbUSvQimbuCWnhKNGheElM8T2V600Xdge+I61Onkb21vraShxffL/ 6Bx5tx7tLv4hwL9lfybRGTgeSxvadmU/XuIoDSPP0pzG8sNxjTac3DHtxeQpPoZbKBNG wRKXnF1S6WPk5YrDJtS1KKcCY/xyrlLBQK8ZaV/c8a7VAAo0nwWqTFWOikfhHIh4kGcs jiQmbpL1glc0NviokDdY2UdVKnzRo1PG0G6lSEvuR1UxzHCBVFP3urqAd/FcgwB1Inrb W7DQ== X-Gm-Message-State: AOAM532ijqrwstqvMeGYfEeW/1WcsLEXXXtcuDLuNOYbZiYTZU5pRNYm HhG05RMoH/tZravFWyQkl8ncIgzkSLtCxZ4md19xdXyteas= X-Received: by 2002:a65:6714:: with SMTP id u20mr18262640pgf.121.1595242387927; Mon, 20 Jul 2020 03:53:07 -0700 (PDT) MIME-Version: 1.0 From: Feng Li Date: Mon, 20 Jul 2020 18:52:37 +0800 Message-ID: Subject: [Question] About IO timeout and hang To: linux-kernel , Ming Lei , linux-block Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Experts, Consider accessing a "bad" disk, if the user process submits a 'read/write' request to the kernel through libaio, and the kernel doesn't return the IO, because the underlay disk is bad, and IO is stuck for a long time. When the IO is a 'read', the user-space process has its own timeout policy, and find this IO has timeout-ed, then is it safe to free the io buffer before IO error return? If the user-space doesn't free the buffer and use this buffer as another read request, for example, read from another health disk, and if at this time the bad disk response the IO, will the buffer be corrupted by the before 'read' request? Could anyone help me clarify this concern? Thanks in advance.