Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5020428ybc; Tue, 26 Nov 2019 19:41:25 -0800 (PST) X-Google-Smtp-Source: APXvYqwsKLaeC6BbO4NQFxOjJmPyXN376Py1TtONpnJ88zIzSzpvbXdLgSkidYLe4KhRTGfOLpMH X-Received: by 2002:a50:9b1a:: with SMTP id o26mr29055081edi.208.1574826085753; Tue, 26 Nov 2019 19:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574826085; cv=none; d=google.com; s=arc-20160816; b=n21iVGFM7+4/hKfATiowh2B/DSdSo0S6PIUGUpt98i90LSr9/EvUQCIcqogXl8vxIj VB2yP2paOyXZytzTDABUBWLQ9nCTfNWNWXOkE7TZl6lBRsB6C5ud4DF1uTlJ/Hm0aQA9 whM5r4Uq99QbQtjrFGRsuCqk6O65WN/FiBmVEdoi9IENqfp1+3j0KUEN26QV6wEh5sCk oSdbCDfuW0aehKzhqW0B9QfLlv+WouyRZGQj4RXnh83swT/njsIXHQEXxDsWKukl67x2 22DKSMNdoGvAgfdUD2wuw+Y/xXMiM+P+NiQ01lHRNYwVw73NIMd0aG9+Q4ixYD8roG+N SYLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=rzLyhMNNXE7eyU2Iz+awfxuo3mkMSFJDgwSXbPEhbKc=; b=Lp8tN3IzTyZlnw/JSonVRCm/3uTd4pB9Db+t1dQ5yYAHskKpURyKSZGrvpuaMnfifX XSnM9ssHXk8wUFAaFXPdhhXS6nQNVc70c+EkDMwTyO7twbGrXQy+9PWWqrTA9MlKpstW Qf1He/Kq+y3DhNFBrHikrF/sWBpG44iIed+FN9dy51PbSsIyJYzY4zMqy9QPDBUQNk0B xLGn+18wFmz10BavME5UqBCo27abjWP/sKbofCUGvXHvAeXrux4pIuQWnnfggxU098Xz EMGWOq8RuOrtIXqqKusUsq2UMrQHKX9gRZw1IWyMhyo51dfppoL0EGlbZMA/TC354YFS BIpg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q25si8553618edw.222.2019.11.26.19.41.01; Tue, 26 Nov 2019 19:41:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbfK0Djn (ORCPT + 99 others); Tue, 26 Nov 2019 22:39:43 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:51842 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726454AbfK0Djn (ORCPT ); Tue, 26 Nov 2019 22:39:43 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9C7981D57FCE35DA8437; Wed, 27 Nov 2019 11:39:41 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 27 Nov 2019 11:39:30 +0800 From: yu kuai To: , CC: , , , , , Subject: [PATCH] mm/shmem.c: don't set 'seals' to 'F_SEAL_SEAL' in shmem_get_inode Date: Wed, 27 Nov 2019 12:00:51 +0800 Message-ID: <20191127040051.39169-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'seals' is set to 'F_SEAL_SEAL' in shmem_get_inode, which means "prevent further seals from being set", thus sealing API will be useless and many code in shmem.c will never be reached. For example: shmem_setattr if ((newsize < oldsize && (info->seals & F_SEAL_SHRINK)) || (newsize > oldsize && (info->seals & F_SEAL_GROW))) return -EPERM; So, initialize 'seals' to zero is more reasonable. Signed-off-by: yu kuai --- mm/shmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 165fa6332993..7b032b347bda 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2256,7 +2256,6 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode memset(info, 0, (char *)inode - (char *)info); spin_lock_init(&info->lock); atomic_set(&info->stop_eviction, 0); - info->seals = F_SEAL_SEAL; info->flags = flags & VM_NORESERVE; INIT_LIST_HEAD(&info->shrinklist); INIT_LIST_HEAD(&info->swaplist); -- 2.17.2