Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp827983imm; Thu, 5 Jul 2018 09:32:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfV+Mqcz6+acKRuCHc8W6fbTSOAc2ydCJyJjlJjBrHNlemjCGT8sOAxEdAexmFmMs//cvGu X-Received: by 2002:a65:65c6:: with SMTP id y6-v6mr6345898pgv.20.1530808359080; Thu, 05 Jul 2018 09:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530808359; cv=none; d=google.com; s=arc-20160816; b=AYqhA+aGnn+obNwMk1G9jwuDTUtyGsSaYoE4vj1T0tfYLj8jLxrUdfaDcepb8Y4QGd BGdC6ONwdLAM6pVO/nKL/nBtpiJP/HjpbDMTmclNIc1SOEU2u1wEyCU/PystG5tWYbO2 YC3dpJ72wC3KckUBQDnlWTD0ZgXNcMk8RYPIVF24BYl8uZteQapeOa5/KlngU2V6sppt jkRMpaaH2RR+WWTYcPICO1ArJboZIVzrIf1OGK/HJAkREQplMPzInb1rI5j+42Hvo2j/ o06gjjS63l/1Eh9Be/M6q84ZnR8mdMPCMm8NK5AJEaiYXgGCcKWMl0O8HvWMnfgdHGoV J9BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:arc-authentication-results; bh=Yg15JjVAg7wekPbYoWpVoflqkr+2RcXasPM4cI8euB0=; b=Ok3GPiAwkgSXpKAy3+FMuRRCwiYSHUI+4jMkciTuDcN6EhR++Q4lATuKWxNKa/kXlF Vcj58WqWyCbGKHAa2vpwg6aljKzxPaRilDdeoF8HKHV+/ypMRUgct6DnrVzI+7aEgtMp hd2q/wYDihOezCoqg04FQmeteRK/ce3mP7rMG/McSZVL2stot5hxEYJ5oStcrkEmEAYb VWpVOzVLUOKJKv7CmfTtleZkjPwwSOMywatv+G53H/MqEtaGzyejABhMoD+EUZnGC50M hdLbvMaUG7KSZk6ROtRPf6i6hHcX5/Bzepx0+eZdp45ZhWA9qqzW3laiSz+ZAavl12tO 7D+Q== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21-v6si6869540plj.180.2018.07.05.09.32.25; Thu, 05 Jul 2018 09:32:39 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754357AbeGEQbf (ORCPT + 99 others); Thu, 5 Jul 2018 12:31:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58836 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754180AbeGEQbe (ORCPT ); Thu, 5 Jul 2018 12:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90604406F8B2; Thu, 5 Jul 2018 16:31:33 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9E9876CE; Thu, 5 Jul 2018 16:31:30 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 4/4] cachefiles: Wait rather than BUG'ing on "Unexpected object collision" From: David Howells To: linux-cachefs@redhat.com Cc: kiran.modukuri@gmail.com, carmark.dlut@gmail.com, vegard.nossum@gmail.com, linux-kernel@vger.kernel.org, neilb@suse.com, aderobertis@metrics.net, dhowells@redhat.com, dja@axtens.net Date: Thu, 05 Jul 2018 17:31:30 +0100 Message-ID: <153080829041.5496.6336874857121191833.stgit@warthog.procyon.org.uk> In-Reply-To: <153080826773.5496.7106875523806885716.stgit@warthog.procyon.org.uk> References: <153080826773.5496.7106875523806885716.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 05 Jul 2018 16:31:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 05 Jul 2018 16:31:33 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kiran Kumar Modukuri If we meet a conflicting object that is marked FSCACHE_OBJECT_IS_LIVE in the active object tree, we have been emitting a BUG after logging information about it and the new object. Instead, we should wait for the CACHEFILES_OBJECT_ACTIVE flag to be cleared on the old object (or return an error). The ACTIVE flag should be cleared after it has been removed from the active object tree. A timeout of 60s is used in the wait, so we shouldn't be able to get stuck there. Signed-off-by: Kiran Kumar Modukuri Signed-off-by: David Howells --- fs/cachefiles/namei.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index b5d6dd72dfa0..af2b17b21b94 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -192,7 +192,6 @@ static int cachefiles_mark_object_active(struct cachefiles_cache *cache, pr_err("\n"); pr_err("Error: Unexpected object collision\n"); cachefiles_printk_object(object, xobject); - BUG(); } atomic_inc(&xobject->usage); write_unlock(&cache->active_lock);