Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp402121rwd; Thu, 8 Jun 2023 02:17:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4puyAUv6lajE6g+XdO4vmrrdLFIlOBDqtmdfIY3Odi1jrRH/pSyrarsaDHJ3tAJNlDfG6E X-Received: by 2002:a05:6808:303:b0:39a:bbd4:bab with SMTP id i3-20020a056808030300b0039abbd40babmr4712756oie.31.1686215844029; Thu, 08 Jun 2023 02:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686215843; cv=none; d=google.com; s=arc-20160816; b=xuGVnqq3ANsbZ0HvvxwgQiT2MrH0aJV3lht54UnhwCbBEeUkP0+b12KbIIala0dSCM KV3lZN9xsmGAq5ms4J+OgT60ve2p74/v/RfahuAX2p5U+EHmb13MK/X3O0qiuCvej+Bk X1HOimxmwz3GRs/mYcoLaNN7QjNuSl23/TEdPwORXhRSZbjXwCpVOaYDtozkbCuRh0Ba 9AxS0Q4g+3eUTFZmvUrOqX3inQAAHuDL/VmMTBjmXtZsXLBjq3uLeL32H5FH2bDt98Z7 4IjN78JGJb5rsqd7h7YooZMN6sPCP556152LwCMNut1tD6b8itKGu1ZFyhLQLpsrY8WK 0wfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M478tZ0BJPqFdShribkt4DG9LiqmYQZeG2OJxmtwTQI=; b=sxoppSnt8CsC2glQouSNBEYcsF1KU7kSAUfJf6L9QgBbHdTAP6e7W9tlKLF4JolcsK aeyMejW/QE0yOqq/JJimZT+JD5WlSZTATrcp7/14+Li2KFZ0eMr7UML++MmY+o7lccv2 15sZJe9YmQoYGMu0NaRWHMeGqQZo5HI/9wskhDzPOcu3E+SNLWxCh8lxnMsVAfF2gaBg IdBi0G6sDsvr+gwLgTHh+Xd2Nb5HrLzoAmF0sWwlwoUmE3L9W+H4SOe2fC1NPaRsJn/S iDyxeWncZUHawir+bdLtI/isGc7SKlknKXxTsB9+QO56BfQ+vYPlEK/JR56UpuTwXOPT 55vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="Yq2Nya/6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a170902e15400b001ae5fb1436asi767930pla.184.2023.06.08.02.17.12; Thu, 08 Jun 2023 02:17:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="Yq2Nya/6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235802AbjFHIs2 (ORCPT + 99 others); Thu, 8 Jun 2023 04:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235684AbjFHIr4 (ORCPT ); Thu, 8 Jun 2023 04:47:56 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6861B270B for ; Thu, 8 Jun 2023 01:47:31 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-652dd220d67so271338b3a.3 for ; Thu, 08 Jun 2023 01:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1686214051; x=1688806051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M478tZ0BJPqFdShribkt4DG9LiqmYQZeG2OJxmtwTQI=; b=Yq2Nya/66Vu5w6nNpTUv8LEnsCGR+JlJ895K/cvR0mlClcb2DLPGqhvMmAhPRnVC6P 5lyLBb0BanEOEB5t67nNrVRDwmL/nXyneeJKirBxtqfYoX82wSUEyObyvO5lBx5WlZjd 7IFu2/h9klmSHROrvtKaxHRzYYf97RrRZ7R6kUT/MptavElCUHxFZYVt8v39v0QUxqH8 MBekCo2B/5+W5SBtVF33Auv200I2Z82VjkUUpo4jXKJb6wedh1dfBUxH68MnoVoVRJcq CehSyCf+cG+5K5kWw96LsHynVXZEpos6blrNXcKzRev92YSyY59ZKV4R2rqBlgxN/CeI vyVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686214051; x=1688806051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M478tZ0BJPqFdShribkt4DG9LiqmYQZeG2OJxmtwTQI=; b=azADb3PtNZgOQvVOgPuBDcCD5gW/1te6cilvWEC7JNh9tg+B18hZ//sv5Lwmv7tDIt iG7nbpPZWReuGBzJfBuj11jXK7rhlWfoVy3sXQbPQdkxgMePXb4PySt7sHoGZnzqO0Lq cIWGcsg958qGl2/N8DUcHwJG3vfog/hYcQRov5Nkbe/0XQv44cM9mRY/DzD4bTUvBB6r lkn0ZuZ/xSYh9DJIcjwbxtL46eIHApDh03jOYcGpiSXqFFZecxHuKyQQGan32U/54KVk RV8quET0kYnpOnuBiZYFdFCdF6/GHTscgP8b40ZyzwfliVW6/GPn/nx7awJL8TuzUiGb gpTA== X-Gm-Message-State: AC+VfDwHK3oAIi7GunOhXjZBQjskhTDtYhF8ZXtmo0dXyglKGIV7wyss DZMIxEA7YrauD4TfT0pG9urJv+o8NwCuVqdlgOE= X-Received: by 2002:a05:6a20:7d85:b0:10d:d0cd:c1c7 with SMTP id v5-20020a056a207d8500b0010dd0cdc1c7mr7184475pzj.15.1686214050909; Thu, 08 Jun 2023 01:47:30 -0700 (PDT) Received: from localhost.localdomain ([61.213.176.13]) by smtp.gmail.com with ESMTPSA id 23-20020aa79157000000b0063b806b111csm614160pfi.169.2023.06.08.01.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 01:47:30 -0700 (PDT) From: Jiachen Zhang To: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , me@jcix.top, Jiachen Zhang Subject: [PATCH 2/2] fuse: remove an unnecessary if statement Date: Thu, 8 Jun 2023 16:46:09 +0800 Message-Id: <20230608084609.14245-3-zhangjiachen.jaycee@bytedance.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230608084609.14245-1-zhangjiachen.jaycee@bytedance.com> References: <20230608084609.14245-1-zhangjiachen.jaycee@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org FUSE remote locking code paths never add any locking state to inode->i_flctx, so the locks_remove_posix() function called on file close will return without calling fuse_setlk(). Therefore, as the if statement to be removed in this commit will always be false, remove it for clearness. Fixes: 7142125937e1 ("[PATCH] fuse: add POSIX file locking support") Signed-off-by: Jiachen Zhang --- fs/fuse/file.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 7fe9d405969e..57789215c666 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2619,10 +2619,6 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) return -ENOLCK; } - /* Unlock on close is handled by the flush method */ - if ((fl->fl_flags & FL_CLOSE_POSIX) == FL_CLOSE_POSIX) - return 0; - fuse_lk_fill(&args, file, fl, opcode, pid_nr, flock, &inarg); err = fuse_simple_request(fm, &args); -- 2.20.1