From patchwork Tue Jun 11 12:06:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13693622 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F2C517BB23; Tue, 11 Jun 2024 12:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107600; cv=none; b=YKXT+BaA6PMCdjwlGuw4C8zZ5oUO0Q42aVQI0ZDAqJ6A3i+c5NtIQzejcZOW6bQ7nbz19I993cW+33LBwTKEXCwHd38bWd6MQGf3x4MSECg7MFChM3gJ7uCaG4JRcsPF/kRVq5GVg/km1zogYrYT9egZZPuAog75xxfj7oZsZEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107600; c=relaxed/simple; bh=vT3LFzEeldwiztQNO1Y8xDg0UBLAPd+cr7YztvybvcY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pud7H4CEvrvAdVdkWIgEs8eWbGPeEYf5Yo3/ko+Kb0z/UMrOHI2vlPkuEy4xUSCmKEYap6vaL+QHgbRghoW0lXyAxyzwTdZWA/uY5msKk+k4cii9rcbrTeAi6SUNBS7dhVQaeRN/i3rFueemzDXEryth053u/MoNhreJQ1BeQlk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fKS3xns+; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fKS3xns+" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4217990f997so27001465e9.2; Tue, 11 Jun 2024 05:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718107598; x=1718712398; darn=vger.kernel.org; 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=QOwdG0ynICYzTSCN8/wPrqg53mKV02DaJh6W/3l/9RE=; b=fKS3xns+N/7rjL0pWjscGPoM7WlUOJ5lfNrEZOGIOXQ0GWPr6/chR7G3F9aRzIWYtk pRcVmkSQm0OR9wmo0Pme84d2myiQp3lCY223+t1Qg2aFS/eC6ksYq0LM8TCT5jCATBfs rtSmOhEOrVOb5g3VUxJAboPlUH9dXCDCEmTVdtFzSbebvzRRie61zcIBtgOjLaKdnycB g4KbRe9DWUTIWzk/KN6fYM4iUVFzfVrYPFcKyEVEsg43oNn70oYmUr5hM0pu4yerFQxb E5DwMnvdg0Zj+nltm+DH5sM6bbmikS2Sl18YpJb5/pWfCVfNhXjHEcWa40CM4wY6DasI jlcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718107598; x=1718712398; 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=QOwdG0ynICYzTSCN8/wPrqg53mKV02DaJh6W/3l/9RE=; b=sVCI7pJAppPGFiOor9oifgaHQU+EjbSmLVeF8q4ypNM1ZjzLJLA1xxWNkd9TOiYfrR YCkiudKYYBpzwMHuiQVSPloWn6aGhec75jFmoN7QxbPj00kyKi/IagEzqJOxSG/dOGIc TIalXhyBj1qJsThQ1n8csTwdsHWFUxiD5pfbj8b3Tl5wtuGSIuLr7YjiWriICdJtcmv6 igbT7XJMfjR6U0S51jZ8LSHvdUjBfYL+ut+CinPxjDXv/rhJkCt1qwSbluNoJdTfWw8C tYN66in/Hi3paJwvOvPSd0ZvGZvzz2t4vdJ7zMkyE/jvFL8z29s/pLtMrtTu1tSU2Jzf jinA== X-Forwarded-Encrypted: i=1; AJvYcCV2jCyznfcRal9vfGebZMab1o+Olewjp1GA8BQsYmosku9UVhKdES3gknP0rCN4T6lPOZoyUlwiBrGD9gyGKjFquMgqigl6VUtBM282PC5gt+PwBDuROrJKymh4XKtCj4Lpdfcv92xvRal/Aw309M6JIgZ2hC5pJ8vzhPXGcnkmhLpKoAe2x/pRPnV/rIs5hes/lryLMBhQR/bN5zKfRyKXzwCzr9uH X-Gm-Message-State: AOJu0Yy3K4D+S4sPtmRWn0vNiBMbkZP62FmXUDgtSEdbBwGOb3i9htj0 B79MLeI7cGPSnwetSiUArJ5KvDbRNjcQ1mbWMBJgv9a9i9nR8SzWsj90RZ2O X-Google-Smtp-Source: AGHT+IEtmY/Agm4jxas58hVUY3XHgbnfPH79M+tPQQDky2tF5cpLFO387l1IuKLpvOK9UVW4UKf51g== X-Received: by 2002:a05:600c:a4c:b0:421:2711:cde9 with SMTP id 5b1f17b1804b1-42164a0714fmr104981655e9.22.1718107597450; Tue, 11 Jun 2024 05:06:37 -0700 (PDT) Received: from f.. (cst-prg-65-249.cust.vodafone.cz. [46.135.65.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215814f141sm209315785e9.42.2024.06.11.05.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 05:06:36 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, kent.overstreet@linux.dev, linux-xfs@vger.kernel.org, david@fromorbit.com, Mateusz Guzik Subject: [PATCH v2 1/4] xfs: preserve i_state around inode_init_always in xfs_reinit_inode Date: Tue, 11 Jun 2024 14:06:23 +0200 Message-ID: <20240611120626.513952-2-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611120626.513952-1-mjguzik@gmail.com> References: <20240611120626.513952-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is in preparation for the routine starting to zero the field. De facto coded by Dave Chinner, see: https://lore.kernel.org/linux-fsdevel/ZmgtaGglOL33Wkzr@dread.disaster.area/ Signed-off-by: Mateusz Guzik --- fs/xfs/xfs_icache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 0953163a2d84..d31a2c1ac00a 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -314,6 +314,7 @@ xfs_reinit_inode( dev_t dev = inode->i_rdev; kuid_t uid = inode->i_uid; kgid_t gid = inode->i_gid; + unsigned long state = inode->i_state; error = inode_init_always(mp->m_super, inode); @@ -324,6 +325,7 @@ xfs_reinit_inode( inode->i_rdev = dev; inode->i_uid = uid; inode->i_gid = gid; + inode->i_state = state; mapping_set_large_folios(inode->i_mapping); return error; } From patchwork Tue Jun 11 12:06:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13693623 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 235B317C22E; Tue, 11 Jun 2024 12:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107603; cv=none; b=bAeaQfsQNfflPBvpulgkgnJ/AKtpOTkAURQnZg/frEZGBLemJNRyDrwokViDRzxAQj4kiHYFIlSaIZoZG+fGj8jp2w2TgaoJXi4ZB+IEr1pCWW0ZMeFMMwKGlbY/oRaNcJ4C6KKGdFzmU4wo5A0kIEXF4IncFHBwszNYd4R2VC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107603; c=relaxed/simple; bh=yY88myOuUdNm6Mk0iu+lQY+4gOScmkEdZ717BfjS0QA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bdPoeDVB6lrMMSMSA+D8lYjGIIXyZUkLu7VvG0tySbYWwsCW66ORlH3/qCo4ii8J+NiPhoe/YREHtQzpUgeiw/qhKm7P5TnJOHCTOD9pV5PpQgvJ58s/dtF4ZByEEG+5ZWIFD1pV0eSVOFWKo2d1J00rjjxOtuT/a1b/KAfX/p4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kqE0ga4y; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kqE0ga4y" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-421b9068274so18988235e9.1; Tue, 11 Jun 2024 05:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718107600; x=1718712400; darn=vger.kernel.org; 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=Z7XhUrCYdhIUl0WvQgOZqj6KAG+JMrYKEpk/f8XC47Y=; b=kqE0ga4yVpriWhZ9a+oGHw6JnAsBesXjtzjmRmacUyqm5c+bqFiTtU2u8yyeKw/cVC dYRjMsCOiDPPskS6AwbjZqGmOW4ch+SHE89N9ypIFpsDzOVIV53d+UORBjGCNDCsA7SB 1OiliJRMeULNtGmNYXlmtArwtjvtHmo9Fnf8DJAvp7jG2Z4C05JpX5grB9mr3j2xlkHO AgxjArUnEOICQhD4Sex1N7jEsMwPoTPqox82/UyKDlId/hzHXIIKqZch1cfN06bfJjYh It520F6xVqsgN2YivrxobvxnALU+ReuOH4Ma6+q4NXJvf4nex+NJq8VLcC3zS4beYKve +jCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718107600; x=1718712400; 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=Z7XhUrCYdhIUl0WvQgOZqj6KAG+JMrYKEpk/f8XC47Y=; b=SxcY+MC9DztMaKwzGgrqNQsZNcFAD2lcwyRxCPhCWX5EtI39iiBMZVd3FaR5PwKXJB BX343T269KPlFQwR4mAk+D4PPdpp18wuEY/L6osACN2V0mx9vp/nzyrA1on1kka3tqgA SoazmKC7CJRo4dxDA0aO1UHwKuVaGfXMriWfAt6y7rF7MP3Qx6QJamIvs+H/g993uNpH TDnSVnYrEisDy6NH14GS5ZaN/G0/6U2rjGo8eLf4qipeIR3ruVDBvKlX8fljSpdnz4kB WnsirOFSO1TwHTHsV2Mc3/oF/WyIWmPlBmZn/bv6tPebf0q+FqE2qceESRlHQpv2Lb3D j3Ug== X-Forwarded-Encrypted: i=1; AJvYcCX+ARbG9FuNXiYWNTfS0+QItazUBm4xcblx8V/Sfa4DWTzdiKydigtFdmXrD6B543LpWg7Ydm06oramJvp2oz7dTuC+QOUaQLwiCUa72TG+CnL/2T+KQhHHmHeM5rQdRpjN2AZ7+i6yCX+X3PEUl5tyUjYOjeCN2YZziTlgJna2xOjwy/CnC5AIapwd7ty5Z1Ow5U9dXuEQDxft2SaGY1JK/H60GQHb X-Gm-Message-State: AOJu0YyCs2blax3QIVLarMYh45o70RFmfPLp+VFTFev/iwWhksFTkIYV In0P4jvcx1/nzOnOdR69GuEC0/KKtaCGpS9GaWMWQUYX7tI/EJMV X-Google-Smtp-Source: AGHT+IHEUn68efWOHcu/b0fFpPapvjoKrnJm47h6BB5MorjLO0UAerbcgyICO9Pba6YeHwffcwKVwQ== X-Received: by 2002:a05:600c:3150:b0:421:791c:4bfd with SMTP id 5b1f17b1804b1-421791c4e5fmr76002655e9.17.1718107600516; Tue, 11 Jun 2024 05:06:40 -0700 (PDT) Received: from f.. (cst-prg-65-249.cust.vodafone.cz. [46.135.65.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215814f141sm209315785e9.42.2024.06.11.05.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 05:06:39 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, kent.overstreet@linux.dev, linux-xfs@vger.kernel.org, david@fromorbit.com, Mateusz Guzik Subject: [PATCH v2 2/4] vfs: partially sanitize i_state zeroing on inode creation Date: Tue, 11 Jun 2024 14:06:24 +0200 Message-ID: <20240611120626.513952-3-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611120626.513952-1-mjguzik@gmail.com> References: <20240611120626.513952-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 new_inode used to have the following: spin_lock(&inode_lock); inodes_stat.nr_inodes++; list_add(&inode->i_list, &inode_in_use); list_add(&inode->i_sb_list, &sb->s_inodes); inode->i_ino = ++last_ino; inode->i_state = 0; spin_unlock(&inode_lock); over time things disappeared, got moved around or got replaced (global inode lock with a per-inode lock), eventually this got reduced to: spin_lock(&inode->i_lock); inode->i_state = 0; spin_unlock(&inode->i_lock); But the lock acquire here does not synchronize against anyone. Additionally iget5_locked performs i_state = 0 assignment without any locks to begin with, the two combined look confusing at best. It looks like the current state is a leftover which was not cleaned up. Ideally it would be an invariant that i_state == 0 to begin with, but achieving that would require dealing with all filesystem alloc handlers one by one. In the meantime drop the misleading locking and move i_state zeroing to inode_init_always so that others don't need to deal with it by hand. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/inode.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 3a4c67bfe085..8f05d79de01d 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -231,6 +231,8 @@ int inode_init_always(struct super_block *sb, struct inode *inode) if (unlikely(security_inode_alloc(inode))) return -ENOMEM; + + inode->i_state = 0; this_cpu_inc(nr_inodes); return 0; @@ -1023,14 +1025,7 @@ EXPORT_SYMBOL(get_next_ino); */ struct inode *new_inode_pseudo(struct super_block *sb) { - struct inode *inode = alloc_inode(sb); - - if (inode) { - spin_lock(&inode->i_lock); - inode->i_state = 0; - spin_unlock(&inode->i_lock); - } - return inode; + return alloc_inode(sb); } /** @@ -1254,7 +1249,6 @@ struct inode *iget5_locked(struct super_block *sb, unsigned long hashval, struct inode *new = alloc_inode(sb); if (new) { - new->i_state = 0; inode = inode_insert5(new, hashval, test, set, data); if (unlikely(inode != new)) destroy_inode(new); @@ -1285,7 +1279,6 @@ struct inode *iget5_locked_rcu(struct super_block *sb, unsigned long hashval, struct inode *new = alloc_inode(sb); if (new) { - new->i_state = 0; inode = inode_insert5(new, hashval, test, set, data); if (unlikely(inode != new)) destroy_inode(new); From patchwork Tue Jun 11 12:06:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13693624 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07EC917C7D1; Tue, 11 Jun 2024 12:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107606; cv=none; b=jAIJK2F5YUo27vk+b/utxnWmKa+ghcPTDaicU5t52eNHjRiG8pfDDcb4SfJoYSjR5Nou0OFG4S1iQGXAviKKG4PdD5nxs7itkOPu9tERuqDVnyKnyMghR7LGeq5YvvgDwu2CPTsC+/T49+FATGd6leUojYohHAfz5L/I2bNweFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107606; c=relaxed/simple; bh=ufUXzSo3VNc1Yw6YK7C1iq2qUtbnpuulVMhXGED8cN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K5fXSmaVTS2cHoPpcYnGV466nOXIxecAnbSGa8e6zovMva5ihx5FX5HWJnYF7P0Iv+u4mOML1LJaqVoYMMWfaIbr/HlQ1/vXNwO4QAA5KEaG7ravRkXs0lebzoeL0dyHy4FemZ0HNR8rFEbjJSScseroegcv3NLqTw4+/+fwNmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aCQCjnyl; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aCQCjnyl" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4210aa00c94so47053405e9.1; Tue, 11 Jun 2024 05:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718107603; x=1718712403; darn=vger.kernel.org; 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=osoKxcalEVuRJFuOqCaTQol01Qi45FmnGSU/HheJSwQ=; b=aCQCjnylq35Rb2OemlU49fJZFxwpYbpYox6QfDpAch9SeDlB4dd1EVRENdKWmtGOEj i3s4hhAbrtFpe5giQCIsOrrTlJRec5JaPTuhwXboCXsdf1qs6EHBS84BrC0jvn8WEBWu yWc9DFV6DeE5qpAL/WTay3OQos0Nxct1KFvjgsOLO/qOe3pXkx/MkjK43+EB063mX/5E dldtfPJBiejUa758SG/mFiZ6pwhAxNzo70JN+0OodX+6VyVBSMuINv/1xm2f5eqDZlb6 xl2jBE3djsSHu+DonO/rv+jIN/FST7KXYvkgSEDsT/gWO6ttAXqzZTlq/N/mcnM8kLS7 r9Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718107603; x=1718712403; 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=osoKxcalEVuRJFuOqCaTQol01Qi45FmnGSU/HheJSwQ=; b=O+y9aUs4GlKzrJey3Gi88LCHHGPwbxyqq+AAAxm/RVPauDy7fykS0thC7JNVwbfEu0 5oU/3K8JUbIM9SFa5+B10AJW9iu0INsUWWW4F/nxko7iaUdo2IJV1AZL5r3igGAgdfLc WFjlIZG2mikElDDN6pbLZ9qqSk8kmvmT1M+Vgy/wVFzAGbcOEOmoVQRUrAZtCbcSortR 0hlncvg3v6XczN5Dm1weP2W7w1XlqEp6eSEeYT+FT/UUmY+5qU1cyyei016p+l+wA7C4 Sn4MQjJr+rjVA5Zrzxz5/iNTJaHggf2qUdvgxLtnpSLNjInEaDGtOC7gorRQJZjdg4x2 eN3A== X-Forwarded-Encrypted: i=1; AJvYcCW5Yp8+VwAtVlSBxyqLZXeL78GTeHmhxaG5sYzVchjcqne963o40qTUgM/JBEuJALBO0fhVXvFh65BLLcqkU0Zw8yJE67+x/ypdf3lCXQF/SQwHkZ6JnQza9sI48hqhmRP583yoEFq9l+i6lWjn7o5Sz3spXHZ6CzJ/1GBZrlsSWi5RV2xb5FPyBx/nmLYTn3gQJn0Z8gJ6cze9C6l44PGswHh7XYwD X-Gm-Message-State: AOJu0YxadQ4gApvQlPEx5+st3x/oqxd5kkKOu4vcYLwwB6ZXxbghCXxc 5qq1Td1JJqy8zdgBmBuheKbo4tFQ9JMYZJ6PGRpEGKj0KsYDK5I8EJeFGrQP X-Google-Smtp-Source: AGHT+IHMKkF27btVhL+Q2ZakKFCmBlBzPJIwFDwowAOUBo13JONA4RymmGK8rX7jF1gvI5caCVEWBA== X-Received: by 2002:a05:600c:314b:b0:422:6449:1307 with SMTP id 5b1f17b1804b1-422644914b4mr11136665e9.32.1718107603309; Tue, 11 Jun 2024 05:06:43 -0700 (PDT) Received: from f.. (cst-prg-65-249.cust.vodafone.cz. [46.135.65.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215814f141sm209315785e9.42.2024.06.11.05.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 05:06:42 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, kent.overstreet@linux.dev, linux-xfs@vger.kernel.org, david@fromorbit.com, Mateusz Guzik Subject: [PATCH v2 3/4] xfs: remove now spurious i_state initialization in xfs_inode_alloc Date: Tue, 11 Jun 2024 14:06:25 +0200 Message-ID: <20240611120626.513952-4-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611120626.513952-1-mjguzik@gmail.com> References: <20240611120626.513952-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 inode_init_always started setting the field to 0. Signed-off-by: Mateusz Guzik --- fs/xfs/xfs_icache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index d31a2c1ac00a..088ac200b026 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -86,9 +86,8 @@ xfs_inode_alloc( return NULL; } - /* VFS doesn't initialise i_mode or i_state! */ + /* VFS doesn't initialise i_mode! */ VFS_I(ip)->i_mode = 0; - VFS_I(ip)->i_state = 0; mapping_set_large_folios(VFS_I(ip)->i_mapping); XFS_STATS_INC(mp, vn_active); From patchwork Tue Jun 11 12:06:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13693625 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5570417C9F8; Tue, 11 Jun 2024 12:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107608; cv=none; b=WRMdljvzbw+L5hp326Y9BczRG0iZ7Ig3HGGZVN7lFz45uLYw+E61gYT1TJSuGP9xIvIVqdsr8qg3YGHMc5hBVRTJOteeGjYqMyUzOtNjbmfVjVc1uh1ZdxaSZPgz1R443wMzs6FvMHew3d4vW8lEPFP88JvM6DK/BRKm9lH5xjg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718107608; c=relaxed/simple; bh=LC/PPNBe913MP1/Zapm7HIw6oeoAmG+QwTk0uG/mMuo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P/Qasu8z9ZnRFof7syrdxnMR4UOQzLBDKLcegRFPX0ZhtB9Hugpq/c0oWfmAjSuvXDzMI5YB0wOkxHZ5yvmw6YiZ02euLQ0uzVQ54lAFJuKZeoG0X/JECsEp6MZrnXGdxB6fhtoC91ZgA2D5w5nbK6lFEzTiD0iaVgDz2rJIs4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OAZl7gn1; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OAZl7gn1" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-422757c0e72so631565e9.1; Tue, 11 Jun 2024 05:06:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718107606; x=1718712406; darn=vger.kernel.org; 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=bxDSFc22TbE5QEL+aATYVz7Hu5KVvQhfb2QlhPoHBBM=; b=OAZl7gn1uJ436v+S38Tl4XgX1CHh5S4j6SvyryoopBZOLQMb5icbbQPVpdE9Z1YTT9 cG/kyweuO/FkvdGg7i06PrOVzwt+a4BSpMInS4yNHuqVVhVVCp6zCUvQQREq849YtI8c 8nJYRfb8Uf3WHNWM41cfCRMC4iXdq2qrjUq3fqidJFGsXVs7nqGuI6IJYS7wptw3+X20 XFeTNQU4uaYo4anAuv0v1+fKD3ksNUbfR8tDPPcBdSaLKk13fxH/LJmUUoKSd/OWO0+H nnoaPGxmTmmfbfJzAWr720sn0+wO3690S5KBhL/+y+Dcy5CV6RuXG/lzYhMKe5vNpVQH mK1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718107606; x=1718712406; 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=bxDSFc22TbE5QEL+aATYVz7Hu5KVvQhfb2QlhPoHBBM=; b=Nxl40J0QgnNkxIr/1LDHFD+hwW+gax5F7D6v4Cgcs4v3QRDiKPLNuWJkWrfVkw8cun YBOFuxFSUNamqSXS1044qv6J4RLc3UKFnpC0Vi1cyH7wqAzIc3VzICGc4K/brFGU5LAt Onvq3vTEPHua0ZJpitbB/EMnvyih98EZc9wfmjgPU2mqYOgQ19lIpcgUlERPQlkrWrGq 7YpvaKuvYwXg7LTMcFFZRL3QzYm0zCoWKFyyaDKFocroTncRWoRW/FAprBHj9IKB3baj TAMomm3KAWGKJD6JAyoLctdX0Iamlxn//4h0QfZXaEBZvOSo5Tq+FLaPsQe5rhLx/tkk qigQ== X-Forwarded-Encrypted: i=1; AJvYcCWMXS0zp29XeppCI3X6bCbPwfMMSE9YRi2A9ibuyoHcdP2h9cJdAk6OMafSsfXVmVCgqjuM+KnUDXSJyvOe3FVLzPG0KIJjTpCa1SYxxknnjsm8+2g1G7W+BpycFqyDY7lM+3eUN6jSPLd+ien5X208ACjWZwVtDqDYYQwz6tN7aN7Mwk0UCQz7oVfnBQPO0a2vwW0zWotT/5rHbZf/DpoAw3tw4tOG X-Gm-Message-State: AOJu0YwR/FWrAD69B9g5EvidbHfPCOHuPJNcICnFLBeLkY/giufBUfYw KAw4WwgrJMeQMN6qrqGs4eiHVn7X6+vjFgQSsou6/RGzgSgnSNrg X-Google-Smtp-Source: AGHT+IHRHj2G4q3Op7dp5LdtPyVP+RyHt5ovPjaHnuV7yKmTMKcujV/2Jqsv/1lgmwqOBvBmLUIU5Q== X-Received: by 2002:a05:600c:45c9:b0:421:8e64:5f72 with SMTP id 5b1f17b1804b1-4218e646ea5mr52211735e9.18.1718107605845; Tue, 11 Jun 2024 05:06:45 -0700 (PDT) Received: from f.. (cst-prg-65-249.cust.vodafone.cz. [46.135.65.249]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215814f141sm209315785e9.42.2024.06.11.05.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 05:06:45 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, kent.overstreet@linux.dev, linux-xfs@vger.kernel.org, david@fromorbit.com, Mateusz Guzik Subject: [PATCH v2 4/4] bcachefs: remove now spurious i_state initialization Date: Tue, 11 Jun 2024 14:06:26 +0200 Message-ID: <20240611120626.513952-5-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240611120626.513952-1-mjguzik@gmail.com> References: <20240611120626.513952-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 inode_init_always started setting the field to 0. Signed-off-by: Mateusz Guzik Acked-by: Kent Overstreet --- fs/bcachefs/fs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 514bf83ebe29..f9044da417ac 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -230,7 +230,6 @@ static struct bch_inode_info *__bch2_new_inode(struct bch_fs *c) two_state_lock_init(&inode->ei_pagecache_lock); INIT_LIST_HEAD(&inode->ei_vfs_inode_list); mutex_init(&inode->ei_quota_lock); - inode->v.i_state = 0; if (unlikely(inode_init_always(c->vfs_sb, &inode->v))) { kmem_cache_free(bch2_inode_cache, inode);