Received: by 10.192.165.148 with SMTP id m20csp4365187imm; Tue, 8 May 2018 07:21:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqy0NuMFRFNWvOqX+yd/Mwnh1xInmr111+ObUz23UwIEdHr9Up55trwyn+ebqrFNmRgF2N1 X-Received: by 2002:a17:902:7841:: with SMTP id e1-v6mr42332684pln.197.1525789304000; Tue, 08 May 2018 07:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525789303; cv=none; d=google.com; s=arc-20160816; b=ZV3NAhIOzEXxa+AUjA9XORsn1gVRMLBKHWfJcnjOUnGWGViBfwhZCovVM98EsHL0yw 0LgDOMbJ6g406WFvtrAIf9ztKahgp288Wdp/qWtm50n9PbA4D1tzmybf5RsEzmdq52rK qjdHcAOn2IBf/ZYJ/2m0xvU+ciUkmPhZXJB3dtCB7Ut0AsUzu1kbWcBUbk85ZeEPn6TK rpdIAL+Yy+Auf5ILdsx+be4l5LjtlFQIQrlZJ8mG7d/T+lI2h+0TAiMLRcqL86hZHh7U MV2OcPhC+99bHgHC/nwnlAGQVqfw5ZhOKrslm+D8vwdcv++mhpRElARlK6IWTw1Mh7Bl WdVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=tRPo+iNNVbiaYEwxomevZpzHtAawqmmaN+j4lWngj1c=; b=FH5BxgjgAu5WTUpO5z1uGT5sSNFnTQ5uauHYzYTRVXCLAV2GrT8JBfE0lYgbvAkjzg hVvMVK1jBC5c5c1VH1C5LWNVw1aiw620YUEAzI6j7nyx0ZFA7IJlCby2MSAjuEqirUL2 akGzcnsYUFT78OpYC5qmXJXx9p3nRnIHka6TJlMaKkkWhDuaZ8q09a1RGNxYBBJW5kft 6CnMDPU72w5imbm5mohT/yRRkqtxMTdN+Rxl/p41LgRJA/eA/jY+DDNLpHaIN55tKZBE Bf3xS3uTdwtlR7g/xNywebhTp0dJejesMfmW4e2cEwmLRiODqOd3KPZDXXqrm1124PHK gctg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RVqlHpU9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u198-v6si20003691pgc.203.2018.05.08.07.21.28; Tue, 08 May 2018 07:21:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RVqlHpU9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932423AbeEHOU5 (ORCPT + 99 others); Tue, 8 May 2018 10:20:57 -0400 Received: from mail-yb0-f172.google.com ([209.85.213.172]:33761 "EHLO mail-yb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932104AbeEHOUz (ORCPT ); Tue, 8 May 2018 10:20:55 -0400 Received: by mail-yb0-f172.google.com with SMTP id y5-v6so11208438ybg.0; Tue, 08 May 2018 07:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tRPo+iNNVbiaYEwxomevZpzHtAawqmmaN+j4lWngj1c=; b=RVqlHpU9nevDJ1zjO8M635YMr6d2aEOmYxd38lBBD1Hd5YUpjIosceOYwfVDaoPeix /dm2DNpNOfW6YjeTybQoe2E3vKA72DqNgreZmwK26cHwYntBIPafRGsrhAA8k3HAZFAF KbdDFrsZAMiHxzPZOV8mQLTHPIbNSzBHuQjZ4IWhU7eh+8A+uncNkcIVeIfYg59k4hLr gPBFapiTfh6hi7D+CLB01AsO6FtgPewmGWq6Iy6/NWL10+RcNHuwGWK7WYhqKDV/OoQX FDI9X5wLP9lbBCuWIx4dvVRtPOADaxZo/6yDSxE0p4X1lMtp5+skQG204UuUPx+3PnwC JFKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=tRPo+iNNVbiaYEwxomevZpzHtAawqmmaN+j4lWngj1c=; b=R8lXnxVUo91dvc9TFN8Oc/BJZZfaT79uYBMkVVTwMcRI2rqvyrY1s0Fj2PRA0lU8SN C1zcr0YfRnGQwe7FvL+OxKT+G5B4nIyg6QCvP1jcC4jcF7d12A8L05mL+NQJfcMm6Zqo 4b26FXcfzoZuFljsV3JrZ6uKWcWgByzvE74MHGMTlMsSq5C2Pl/FVXxX8yOftJ0FkkBL kiLJ2ztl6vLgTmR6L5IqWymbHctILzyhaREU7O+Fa6f8lkZFjB1ipvHU/uXzLesaCA2h rrol683o8NNsGojVSvbyXtNiBQRK8zkZnRoXcOUyr7m44cvsGBE8eHj4KxaQGPbYMcic TDlw== X-Gm-Message-State: ALKqPwekikDqK6gCELFxuUih7/KDOh1CQT415HPO2YHcXK5YAZWUuZBt RoVNl2dQWtyphEF+j/DJK9Y= X-Received: by 2002:a25:c7c1:: with SMTP id w184-v6mr4996434ybe.418.1525789254843; Tue, 08 May 2018 07:20:54 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::6a99]) by smtp.gmail.com with ESMTPSA id f81-v6sm4356332ywc.77.2018.05.08.07.20.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 07:20:53 -0700 (PDT) Date: Tue, 8 May 2018 07:20:52 -0700 From: Tejun Heo To: Jia-Ju Bai Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ata: libata-pmp: Fix a possible data race in sata_pmp_handle_link_fail Message-ID: <20180508142052.GK2368884@devbig577.frc2.facebook.com> References: <20180508082140.14038-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180508082140.14038-1-baijiaju1990@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 08, 2018 at 04:21:40PM +0800, Jia-Ju Bai wrote: > The write operation to "link->flags" is protected by > the lock on line 898, but the read operation to > this data on line 892 is not protected by the lock. > Thus, there may exist a data race for "link->flags". > > To fix this data race, the read operation to "link->flags" > should be also protected by the lock. Same as the previous patch. Thanks. -- tejun