Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6133396iog; Thu, 23 Jun 2022 12:03:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJceUisyoDn4ZMcTKx2L/ppt0tueS7jlruam5w3TslxqGpeTXFsS3i9FD4nbUIfVuIKyU8 X-Received: by 2002:a17:902:f685:b0:16a:3c40:e3b5 with SMTP id l5-20020a170902f68500b0016a3c40e3b5mr13334064plg.106.1656010998065; Thu, 23 Jun 2022 12:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010998; cv=none; d=google.com; s=arc-20160816; b=KNS6pa8ajjsyjjzg/v2fSHEhj5CoBiDRNAfEZhWibIOJDUkcgxlgqOX7hICrWe+DPj xzlDwohTKonqWtFWq+fSdY7bvbFAzNC6sDcDRlop4R6V47+rKw2FQfYBPbBCznZReFxf 81flgv/ykG946Ay61DJj5+f82oqhxAUXB9I+hcnLHf0pSX8h3vn+wHw4kQg6SGwEznjw ht+Sz3NRJcYpBI8eyEAT+CiT9Qoj4tdtpMsPyP4rz6sZ/aQFpSJxXzFmXnumr8uDoLeL 89gDO6sYvsDKXB23UFVHOBZcFnRxsk48QZScguhfWluNmRpwRWnefchXUBkSEgTPLLbS 9h2w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ucXnFPBGXujZXwQKBn/Ua74vcdTCQjbbXYM9dtYzmB8=; b=fqEbpzZDl5d4S10iXRKY1rtG4wlUAe9SZnps4T+3RwKPLLG3394q0ojsSoM/9larHz zcZtPxCeQr55wHjjvgK1TImitAWMRERqO9k8D6Vz4nE0IJ9Z7UZw1JH57RzLPD6ufUlW /BCpJIe9GCnlCrgJONHRVffAgKQ1QhYlRITebOuLWR4CJX7GFprkaCGLoOUz0dE3V+6S /AN4ioHuScyJS/ro4LzioyA7TnhhOfLFrog2k3G61daJSL0eQFUng/UUT+ykpCSvGLD7 7okw6xCDjmJebPj84ahdxA1f50BUIYCHiNLp1RuMBmsjTG+ARGCH3eqxJ0EiEXp6Dbj7 kH9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LGXZd3KV; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c36-20020a630d24000000b0040cc39c0356si14998074pgl.548.2022.06.23.12.03.05; Thu, 23 Jun 2022 12:03:18 -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=@linuxfoundation.org header.s=korg header.b=LGXZd3KV; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230446AbiFWRwN (ORCPT + 99 others); Thu, 23 Jun 2022 13:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235267AbiFWRvu (ORCPT ); Thu, 23 Jun 2022 13:51:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F42099171; Thu, 23 Jun 2022 10:12:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B829061D1E; Thu, 23 Jun 2022 17:12:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 821F8C341C4; Thu, 23 Jun 2022 17:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004347; bh=8Sv0Q8qy4eIop8tqsKgUXUv461v8jb9UsX/8hx8exeA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGXZd3KVb7Gmra2ow9AwXS5lriWVtk0f4FbxSUYtI/VXTz5xj5LruhxP6S/Xui2UK Boi8msanQQpCCUj6Htcokx2Gi2PqOqgRX84jQNu6HR+BkrT/bi2G75iubormcwAJ7c xup1cNx69i5FOYAZj7zRgI5cubcktdvGIoj2+x+M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tadeusz Struk , Al Viro Subject: [PATCH 4.19 001/234] 9p: missing chunk of "fs/9p: Dont update file type when updating file attributes" Date: Thu, 23 Jun 2022 18:41:08 +0200 Message-Id: <20220623164343.089091177@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Al Viro commit b577d0cd2104fdfcf0ded3707540a12be8ddd8b0 upstream. In commit 45089142b149 Aneesh had missed one (admittedly, very unlikely to hit) case in v9fs_stat2inode_dotl(). However, the same considerations apply there as well - we have no business whatsoever to change ->i_rdev or the file type. Cc: Tadeusz Struk Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- fs/9p/vfs_inode_dotl.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -656,14 +656,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl if (stat->st_result_mask & P9_STATS_NLINK) set_nlink(inode, stat->st_nlink); if (stat->st_result_mask & P9_STATS_MODE) { - inode->i_mode = stat->st_mode; - if ((S_ISBLK(inode->i_mode)) || - (S_ISCHR(inode->i_mode))) - init_special_inode(inode, inode->i_mode, - inode->i_rdev); + mode = stat->st_mode & S_IALLUGO; + mode |= inode->i_mode & ~S_IALLUGO; + inode->i_mode = mode; } - if (stat->st_result_mask & P9_STATS_RDEV) - inode->i_rdev = new_decode_dev(stat->st_rdev); if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) && stat->st_result_mask & P9_STATS_SIZE) v9fs_i_size_write(inode, stat->st_size);