Received: by 10.223.176.46 with SMTP id f43csp1151760wra; Fri, 26 Jan 2018 12:46:59 -0800 (PST) X-Google-Smtp-Source: AH8x224clk6v1eO5tLxSYmz+bUaGa7LTeEcf0/+M4biThz0/I7459g+Pr5vhpDYJBZKqodl0gJsy X-Received: by 10.99.56.18 with SMTP id f18mr16147774pga.438.1516999619750; Fri, 26 Jan 2018 12:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516999619; cv=none; d=google.com; s=arc-20160816; b=KGHxMD+PxH39JWbuBvAyjcXHH8kREOjzyBoPP24+Gkg/H3z8zcwHON5vQA7JAnro0K 0QcH8SPqWxV87cUBzS2CYnYDMToTOXfgXNOHUg205c9O/FHV3zmihxdcW/0JdOfO0/+v SKNUSSfooAkvRnOljy0XHwCOE13VDj/o1OlzMCaW5MvA+15CcD9WZlc2sZue80Bv5xTz KYaQJF5XatEzmEE9uw0Fuhf7BXsIXBrynfp8BDuQfZtTns9s2y1EnOjns7pxglQa8uIP rdMEblZyc6DONezso+VPdtusVud2B8cJNxoT+5wMbOIhtfIHAdm770jiW0b/5P7c23fq IGeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=xCCySqpV3gI2Kk6Y1gi5hlsgzMMUn/J79dfElo6SqNE=; b=Daejx+KpiiYxIRuU7hVaHZYI+wIlhYXzfASzEQ5v+4WTgtmoiDpOwzhfOYdOdkFwXB tVO40pzAgKJtUTcfYwPk1HRqija1QcjznpWSrdd37rlxQlf3cbMV88Mk3z9O4X/opbvN VUpGNdwIFZDcXKBSwGs4TZ0jnChdb8vb+91oSU5XEYObIQJNT8Lv8pzhg/plOXCeUjcM wPwe3ttxyevk4WSw0Wf4ziV5A/1eT2WFAcB+i4bPDcQfKwHh+mVyvl2rznA3zU2QOEIo C6EAAZHX6ZyhWOVxPfPh/HVrvvD7cIfpKKjBj6G16hf5JQP8pmdcCETEtRMyOugkf1JS B5EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Q9CVkGnH; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8-v6si4128366plz.719.2018.01.26.12.46.44; Fri, 26 Jan 2018 12:46:59 -0800 (PST) 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=pass header.i=@google.com header.s=20161025 header.b=Q9CVkGnH; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751613AbeAZUp7 (ORCPT + 99 others); Fri, 26 Jan 2018 15:45:59 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:40395 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeAZUpg (ORCPT ); Fri, 26 Jan 2018 15:45:36 -0500 Received: by mail-it0-f45.google.com with SMTP id 196so3089613iti.5 for ; Fri, 26 Jan 2018 12:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xCCySqpV3gI2Kk6Y1gi5hlsgzMMUn/J79dfElo6SqNE=; b=Q9CVkGnHa2jIMWDcLNXjqOzvFcTbE4CIuc2+xW9w9rlfbOpw3+LRtxPhNGNxeqr8kZ zmR4zS6oSWJajQhBwXr/T3JJa3kmHSyozq144xxONbxu4+6JW6ucpzCATTvlv2d98s56 1WUsm7gxeNK/WyWbDioK2mZxF+avnDiYAINIAXZudfKagUcuyACxo8fzCBmibVi79GkG qL412yjV8gpUClBxSd2TzQyCBOZXFCV/Swh2Vaes9dmrO0oQ+3G0xnPrhU55PxiHUVHU 5pLgPhhuRcY1/e0mPh0YS1G9BnMIxNE+l5vvLCxr5uNnqkajQDrbBQ2DuWZHjWqimwG7 OrDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xCCySqpV3gI2Kk6Y1gi5hlsgzMMUn/J79dfElo6SqNE=; b=N6fsXwUKHGYnxcBbNAIdpdAm/2rwEd4BcHLt9axAoxJUTA4te2YtUkVeVNXNySx91C NaP7cK8FW68H+w06Z13K7OW9hwK+j1jBMHU26GI8D/ZP+dCPW6UVEQ/zzBvNxUv9quzN t8urY1jpkyOiqL1JkJIxYInz0m3edb24C6CtQIfOvNHx095NHPUplFPPGa/TG0X1rTj7 UWodqShnPZE8CWAOTeguU+oZNWmLqyejwKrjybq58VqpAoy/73LxkfQAtX4uK0PI/D8C ehx4GBPSYnTrX8zGUAeQD3Cv2VozwsnxYiiGHwsYx4LweaYURqu/uOi1shhw6/n3mSVr vASg== X-Gm-Message-State: AKwxytfupFbVur+sMRk4eh7IWmOdbX/Af5FBsEWrtROYVqeRvPAe9Blt p6BL2JwwsRJyvARW1wFbTrh4KnRxqmwDzexXojru0g== X-Received: by 10.36.166.67 with SMTP id r3mr17782354iti.33.1516999535325; Fri, 26 Jan 2018 12:45:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.172.135 with HTTP; Fri, 26 Jan 2018 12:45:34 -0800 (PST) In-Reply-To: <20180126193954.GB13338@ZenIV.linux.org.uk> References: <20180126024649.200330-1-joelaf@google.com> <20180126031346.GW13338@ZenIV.linux.org.uk> <20180126193954.GB13338@ZenIV.linux.org.uk> From: Joel Fernandes Date: Fri, 26 Jan 2018 12:45:34 -0800 Message-ID: Subject: Re: [PATCH] ashmem: Fix lockdep issue during llseek To: Al Viro Cc: LKML , Todd Kjos , Arve Hjonnevag , Greg Kroah-Hartman 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 Al, On Fri, Jan 26, 2018 at 11:39 AM, Al Viro wrote: [..] > >> But one usecase for the mutex is with concurrent lseeks, you can end >> up with a file->f_pos that is different from the latest update to >> asma->file->f_pos. A barrier could fix this it too though. Any >> thoughts? > > lseek(2) is serialized against lseek(2) and read(2) on the same struct > file - see fdget_pos() for details. Ah right, Ok. Thanks. > ashmem_mutex really does look like an overkill - something much lighter > should serve just fine... There's also the issue of asma->size getting updated from while being in read ashmem_llseek (although this is a theoretical concern): if (asma->size == 0) { ret = -EINVAL; goto out; } Which could just use READ_ONCE and WRITE_ONCE instead of the mutex I suppose? Other than that, I don't see any other issues at the moment with dropping of the ashmem_mutex from ashmem_llseek. thanks, - Joel