From patchwork Tue Jan 23 15:25:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527594 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 5EC4750A71; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; cv=none; b=kKkrsCgONn8pkuptGTvDDvTQyScesExBdRZIXuErQTOg+lSp+tVDW3UtxESRQFbSNWTWPS31ksRg/pNFCtCM08oug08fi4Aj4vsfk6VXTJR/j+2sA1JrbOKuPWtpdtyyayKn+Cz23cj7LXQqM2leQIoOKWFITSXzAmgPfkS+Iqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; c=relaxed/simple; bh=5bQr+Ha8gFH12hdvNUJslYgvohqb5ImCJsuLlAN8XXg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lpnZR2rlR02fxfjjGQAytOUhxx2QifLdmPEMGtTFxN8H1SSyKBRxvhMbV+GJw4LSfDwvSE3iOCCIqjgLhuDDlQ5Lpwud3eI6KGpzxruHo1L3F2PDgOQBufybUrdTEQCr/1VbEwONx48kWUr0Gc03tPE7En4hPuSaSheYwnoLwqE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Lf1RTar0; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=ukjFYIuX; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Lf1RTar0; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=ukjFYIuX; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Lf1RTar0"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="ukjFYIuX"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Lf1RTar0"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="ukjFYIuX" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 84AD8222AC; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eu2ae060uuJ6wXoYcqiz2HGb2x/G8FHqkHENUKtU6P8=; b=Lf1RTar0lo+5fDJ9W+ZyyGXvUiLtctp2h9QpusKE+8Eevo5AtvqSR9LzW5qykWhlYvUrsz coB29xwW3AGSn5BttKslxkGUNnsy4YeWlPgj2GzMW2ZW8/j/rz3beBZyEHWenwwLx/oBLF xdCsx5RcCMSgK2nrd9uaGWUIWesZL9w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eu2ae060uuJ6wXoYcqiz2HGb2x/G8FHqkHENUKtU6P8=; b=ukjFYIuXSUw5K6+eqs0VsSFG68QAW9p+0ZLmfr0nsU/S84f1hB7n7D0lTTHVYFWcWteyZg TBtF1vJPLzSjhVDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eu2ae060uuJ6wXoYcqiz2HGb2x/G8FHqkHENUKtU6P8=; b=Lf1RTar0lo+5fDJ9W+ZyyGXvUiLtctp2h9QpusKE+8Eevo5AtvqSR9LzW5qykWhlYvUrsz coB29xwW3AGSn5BttKslxkGUNnsy4YeWlPgj2GzMW2ZW8/j/rz3beBZyEHWenwwLx/oBLF xdCsx5RcCMSgK2nrd9uaGWUIWesZL9w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eu2ae060uuJ6wXoYcqiz2HGb2x/G8FHqkHENUKtU6P8=; b=ukjFYIuXSUw5K6+eqs0VsSFG68QAW9p+0ZLmfr0nsU/S84f1hB7n7D0lTTHVYFWcWteyZg TBtF1vJPLzSjhVDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 70A05139B9; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6xANG2Xar2WcdQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id D60A1A0804; Tue, 23 Jan 2024 16:25:20 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 1/9] udf: Remove GFP_NOFS from dir iteration code Date: Tue, 23 Jan 2024 16:25:00 +0100 Message-Id: <20240123152520.4294-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1181; i=jack@suse.cz; h=from:subject; bh=5bQr+Ha8gFH12hdvNUJslYgvohqb5ImCJsuLlAN8XXg=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pMvnPhSSAbDWXgDn8IPkr058JslJ+zOPfDwL0g j/lPZv2JATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aTAAKCRCcnaoHP2RA2YDgCA DZ9mWJSopbKG9E5G8rtSGZZe8jjPfgUIhcZVwDNo2p0jkR7s/AYR4EU3cneG7Wn6wqWzLgqW1YLAOa iZUd9Odxx95Adljq7Miomd6SHBH4t5GaiTmEwnD0G7ISvkDioql7CwXfJc29QnARgMz5y0a5aiRlfq TdMtg6vD4hEy6qmMhvmPwawg+E8zF5A7tI2xHMUJSbgTjJ+RU+sGMspFeD/znXLlDdlK7AKnnKBHI6 fpaXHWjQaX7BF0JNG72G+Xe9ViExZHTNkhWpgSewUH+MKo24uj9tdL3QBTHr3ZWYgASYQSfy5l6S8S O54olkmkfEaoN3u9a/XM/q2ZrUA81G X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO Directory iteration code was using GFP_NOFS allocations in two places. However the code is called only under inode->i_rwsem which is generally safe wrt reclaim. So we can do the allocations with GFP_KERNEL instead. Signed-off-by: Jan Kara --- fs/udf/dir.c | 2 +- fs/udf/namei.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/udf/dir.c b/fs/udf/dir.c index f6533f93851b..f94f45fe2c91 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c @@ -67,7 +67,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx) pos_valid = true; } - fname = kmalloc(UDF_NAME_LEN, GFP_NOFS); + fname = kmalloc(UDF_NAME_LEN, GFP_KERNEL); if (!fname) { ret = -ENOMEM; goto out; diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 1bb6ed948927..1f14a0621a91 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -59,7 +59,7 @@ static int udf_fiiter_find_entry(struct inode *dir, const struct qstr *child, child->name[0] == '.' && child->name[1] == '.'; int ret; - fname = kmalloc(UDF_NAME_LEN, GFP_NOFS); + fname = kmalloc(UDF_NAME_LEN, GFP_KERNEL); if (!fname) return -ENOMEM; From patchwork Tue Jan 23 15:25:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527600 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 5EEF05FDA8; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; cv=none; b=h+KRcmWIg/szh20slZz/At5Nk2Z1kj6w3NacSCmsdA71CYYxWRHbxhHAKViJUYQsO+R5nRBXF900C7vaQTPo9nxS2ozc6+j7mO+sy+OVZerBxmach2V+bogL4tP23SnlyLveX/18OGINFdjh4FfBOFLeYG0OzOCceZ9p4rUFBfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; c=relaxed/simple; bh=d1tqk9pM/ddtJvyj9S6dFod5AyFAwtJGbDdV1UWXreU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Pz6InYsUZ/XEOSUO81QMyB4oBUiH+kWSCW59n7/lJKrZ+ct/4W4kykAEbI6pZ1rW7puQp2F1dlXNOxwPo4iqasffIBIJrLx5yH0aqOtdmyA9Xscf3KqsvtgDD+Zc3EXQ5YGvDCXMKdCuB7yEioF/w27PjZnPS6McEiKwuRwzw6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=F0XCj4sn; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Img9Ukus; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=F0XCj4sn; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Img9Ukus; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="F0XCj4sn"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Img9Ukus"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="F0XCj4sn"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Img9Ukus" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 88433222AE; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSaRDDQDwsiD1Y1foF20EzTyh/dfdKCx53Nrh9WiiTA=; b=F0XCj4snRe3c0hkpj+Q3uQmtJawfuvGiQ3V8pxM5ocvXPINeYPwMdbS75pJqAeOWDnCciF TEnNcnYF01JV/DkBenW3lRYs2N77zqRQEsboyfJfH3FAF4ZI7E3ob3EJcXva6m7d47nH2R poZMhpv7oaipi6hSHFqTIclhCvKOQ3E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSaRDDQDwsiD1Y1foF20EzTyh/dfdKCx53Nrh9WiiTA=; b=Img9UkushSZCt4ySdZPIHADfAA8gGoo5Sjv4p9WA15SaH3vkZNRQgCRF4OLCjM8cwVH8GF ezqRfRTPE/RldJDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSaRDDQDwsiD1Y1foF20EzTyh/dfdKCx53Nrh9WiiTA=; b=F0XCj4snRe3c0hkpj+Q3uQmtJawfuvGiQ3V8pxM5ocvXPINeYPwMdbS75pJqAeOWDnCciF TEnNcnYF01JV/DkBenW3lRYs2N77zqRQEsboyfJfH3FAF4ZI7E3ob3EJcXva6m7d47nH2R poZMhpv7oaipi6hSHFqTIclhCvKOQ3E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hSaRDDQDwsiD1Y1foF20EzTyh/dfdKCx53Nrh9WiiTA=; b=Img9UkushSZCt4ySdZPIHADfAA8gGoo5Sjv4p9WA15SaH3vkZNRQgCRF4OLCjM8cwVH8GF ezqRfRTPE/RldJDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7563E139CB; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GNUtHGXar2WddQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id DD6E1A0806; Tue, 23 Jan 2024 16:25:20 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 2/9] udf: Avoid GFP_NOFS allocation in udf_symlink() Date: Tue, 23 Jan 2024 16:25:01 +0100 Message-Id: <20240123152520.4294-2-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1725; i=jack@suse.cz; h=from:subject; bh=d1tqk9pM/ddtJvyj9S6dFod5AyFAwtJGbDdV1UWXreU=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pN1M/IoDrUnaLEy2dVLYKzQOGfyAWa7EzgmbM/ Dzkex1mJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aTQAKCRCcnaoHP2RA2R0zCA C2vZ09if9/v0XAh0E9R8G1ImutG9EDcD8FdUfp8wP6fVOxaOmMsDuYvugXF6gHotOxnR+k7W+OTvGI 8b2HqX8cJ/vDEE9UG3LoOWeRYMkCh71TW58NycW/U9hQx6dN73jH7ml/pNZuwI5NMu3HRVKehXi3hi xM0ESE+37kGW0cRb0BE02iCgweQHA7s0d886yOGFk5jyc9KSUxNo4S5ZlrFNPovt+50X9cHd4zO3Zs 2EigiG9G3jW1H5HaQSqsvDiVQJox1RjAiFKI4kh2SzRd90euGiYssRNd6p5EkYhv+R1R+VlgoqrpEj e5biv5iptzxR/B8M1g40DYITSC5M2T X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO The GFP_NOFS allocation in udf_symlink() is called only under inode->i_rwsem and UDF_I(inode)->i_data_sem. The first is safe wrt reclaim, the second should be as well but allocating unde this lock is actually unnecessary. Move the allocation from under i_data_sem and change it to GFP_KERNEL. Signed-off-by: Jan Kara --- fs/udf/namei.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 1f14a0621a91..1308109fd42d 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -566,7 +566,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) static int udf_symlink(struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, const char *symname) { - struct inode *inode = udf_new_inode(dir, S_IFLNK | 0777); + struct inode *inode; struct pathComponent *pc; const char *compstart; struct extent_position epos = {}; @@ -579,17 +579,20 @@ static int udf_symlink(struct mnt_idmap *idmap, struct inode *dir, struct udf_inode_info *iinfo; struct super_block *sb = dir->i_sb; - if (IS_ERR(inode)) - return PTR_ERR(inode); - - iinfo = UDF_I(inode); - down_write(&iinfo->i_data_sem); - name = kmalloc(UDF_NAME_LEN_CS0, GFP_NOFS); + name = kmalloc(UDF_NAME_LEN_CS0, GFP_KERNEL); if (!name) { err = -ENOMEM; - goto out_no_entry; + goto out; + } + + inode = udf_new_inode(dir, S_IFLNK | 0777); + if (IS_ERR(inode)) { + err = PTR_ERR(inode); + goto out; } + iinfo = UDF_I(inode); + down_write(&iinfo->i_data_sem); inode->i_data.a_ops = &udf_symlink_aops; inode->i_op = &udf_symlink_inode_operations; inode_nohighmem(inode); From patchwork Tue Jan 23 15:25:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527595 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 7EF325FDAF; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; cv=none; b=HY/BaVuIklNh7adhQWyGCsnylBqJNkTJoxmFG4u4mqINReHtFpfvgyzr2m/PnZEFGNBLWchSh4eZAekP650fLHA8fEIsgLqyRGKM+GCvnlDRCzJ0b86JnC4V0QSoKKd1MRNXpl8bBO7cwGahmHl+p3hUk4pPKll1rv56d/sMq9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; c=relaxed/simple; bh=njkZ7eQ3hNkN3oQBJ9/Q5jandzQ7F3U57UqHwYTh0NM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AEHiBYpn9tmK5/C8oxOAdVgWIHjJHWsaOnhq3RUsfENH5j3I/mi4foqkPZ3po6MuWgLcIgM/NRdTjGPrBVN7XTwA3HtSVujg2lqQvKaNpKwCozpQNnFW32GjBvDdrLrfxSY5khuLNPqLClho2PuLc/Of2Cofd30Bz0V1wlT7GsI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=LlSuF+Ls; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Di/3X+3e; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=LlSuF+Ls; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Di/3X+3e; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="LlSuF+Ls"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Di/3X+3e"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="LlSuF+Ls"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Di/3X+3e" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 732F91FD55; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v/XNthL/uLGWWNEYcTeLr3Oy1DGRnIPkZ9IP8zvk5gw=; b=LlSuF+LsXCHxYwkNqetvkSeSkV73+GPk2yNRGM2mI5JJg6FGUVwHvniIFmKb57vUu972+d rHsGykynzX8GcACzvOYj6M8+yTp67M927YEO/OerNd8Q2Z8xn6wnOj4VKcaZcmjHS5759X 7ECvMlY4G/NXm0QfpH0rbIXgQV89i3g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v/XNthL/uLGWWNEYcTeLr3Oy1DGRnIPkZ9IP8zvk5gw=; b=Di/3X+3ecOvAQa4/7ZEr3uySkmaDba6QEwU4+oNeJy9zG4rQTFFm6WpjfqoANtnAgadYN5 dIlKLNMa+042+VBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v/XNthL/uLGWWNEYcTeLr3Oy1DGRnIPkZ9IP8zvk5gw=; b=LlSuF+LsXCHxYwkNqetvkSeSkV73+GPk2yNRGM2mI5JJg6FGUVwHvniIFmKb57vUu972+d rHsGykynzX8GcACzvOYj6M8+yTp67M927YEO/OerNd8Q2Z8xn6wnOj4VKcaZcmjHS5759X 7ECvMlY4G/NXm0QfpH0rbIXgQV89i3g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v/XNthL/uLGWWNEYcTeLr3Oy1DGRnIPkZ9IP8zvk5gw=; b=Di/3X+3ecOvAQa4/7ZEr3uySkmaDba6QEwU4+oNeJy9zG4rQTFFm6WpjfqoANtnAgadYN5 dIlKLNMa+042+VBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 618FD136A4; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 9bkpGGXar2WVdQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E32E6A0807; Tue, 23 Jan 2024 16:25:20 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 3/9] udf: Avoid GFP_NOFS allocation in udf_load_pvoldesc() Date: Tue, 23 Jan 2024 16:25:02 +0100 Message-Id: <20240123152520.4294-3-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=672; i=jack@suse.cz; h=from:subject; bh=njkZ7eQ3hNkN3oQBJ9/Q5jandzQ7F3U57UqHwYTh0NM=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pOrrM4JvYZiIEsp4gI3GM0vKSMH/HU9au+Q4Oi Ib0PoUuJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aTgAKCRCcnaoHP2RA2Se2CA C0/3CQ/IPIsZ58ucQL1ugn4ajrLdfz4LjYbqL7HoTn+t7Wbmb1apV237JZ37a4GP3W63a8ZHW0DiWe d9YESyEiUgqv3jaWRLxCjIvBxCekmaE1lQ3GoZjLAlWYNl0Sv+3OJVCMZIwaQuJhrMSONPEcSaD/36 uSXG80CRY8PZOx4MxL841TAXnNOWJAZWZKDMpa4L13IPXV17IUkW/tOhmLrJHK4EHQxEeCdvW5GBl4 rjKbnznWeCb+TuqLf63xNL7z5/NpqRFM6ctJFEAniMMxXyFSKh4putuCeFA38Us+8ECxtvX6D0crut WOOlw1R53FEkxwtKt4+BpB+v0fja6B X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=LlSuF+Ls; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="Di/3X+3e" X-Spamd-Result: default: False [4.69 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.69 X-Rspamd-Queue-Id: 732F91FD55 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ udf_load_pvoldesc() is called only during mount when it is safe to enter fs reclaim (we hold only s_umount semaphore). Change GFP_NOFS to GFP_KERNEL allocation. Signed-off-by: Jan Kara --- fs/udf/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/super.c b/fs/udf/super.c index 928a04d9d9e0..0a15ea436fc2 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -864,7 +864,7 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block) int ret; struct timestamp *ts; - outstr = kmalloc(128, GFP_NOFS); + outstr = kmalloc(128, GFP_KERNEL); if (!outstr) return -ENOMEM; From patchwork Tue Jan 23 15:25:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527597 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 5EB0F50A69; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; cv=none; b=o2TccfEqtM8sWHGDC16+VhTNmR6dGfYwVWBn8z1jfx5HRcufAOk9wPH6M0UV3pRfAY+Ay0mWTT0rAePUFvf2Y47S3yEzVtXzqVaXZfAjAede2vOZt1VHXIhFk9US95ck7bfavUUxolJSQXR9yNeqhPRXSSPKeECflyTs8/WtqLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; c=relaxed/simple; bh=RYcHNi+xKW7jK9A61eUsZ9qSxqKSTDlx6JYBz35Kcfk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ldKQftxjXCZ6TIMJFxLXT/Yty065mRpunyc8kSZNgPMqDRxAJBAfqcZjAcoF0CyucL+8wjMJ1Or2VzvapeGx5nfRUDWWTyE85Nu1VQPC+scz5PljlvnopOlpPQ2MHSuWest98fVS8Ny9Em3nCSPKSaEneEmN75FkXG6WRBwFSdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Gt+VT4IA; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=cqYtvH7g; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Gt+VT4IA; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=cqYtvH7g; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Gt+VT4IA"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="cqYtvH7g"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Gt+VT4IA"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="cqYtvH7g" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 79C06222A4; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzLJs0PCqRN+5hB9gyvhRk6iW2jsPO147i/0WvAWKUw=; b=Gt+VT4IAZ1WN+/XwjbcqTxEvqJ2hnnov7df/Hz+GT3LXJQDGzn1rK7XFgCmCXM/MJcAzKa BZm5kF/fJv89bImOfqNnyhaU7sgTRQZhJ9Ky6XXd/yhx2KSMWls9rmUx0wSFFMiWxh/0Wx QBSrnY2lwZAVAtC9tvXh6MO0ovVn+XY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzLJs0PCqRN+5hB9gyvhRk6iW2jsPO147i/0WvAWKUw=; b=cqYtvH7gdAAgPzSh1eF60VHBKRzl2E7Xcz02gvQjzKNDugCeHonBu+Myld4zpqvSmVpoq+ +Sxc4hGgJYWRDzDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzLJs0PCqRN+5hB9gyvhRk6iW2jsPO147i/0WvAWKUw=; b=Gt+VT4IAZ1WN+/XwjbcqTxEvqJ2hnnov7df/Hz+GT3LXJQDGzn1rK7XFgCmCXM/MJcAzKa BZm5kF/fJv89bImOfqNnyhaU7sgTRQZhJ9Ky6XXd/yhx2KSMWls9rmUx0wSFFMiWxh/0Wx QBSrnY2lwZAVAtC9tvXh6MO0ovVn+XY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TzLJs0PCqRN+5hB9gyvhRk6iW2jsPO147i/0WvAWKUw=; b=cqYtvH7gdAAgPzSh1eF60VHBKRzl2E7Xcz02gvQjzKNDugCeHonBu+Myld4zpqvSmVpoq+ +Sxc4hGgJYWRDzDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 68BBA139B1; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id tSuLGWXar2WYdQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id EA7C7A0808; Tue, 23 Jan 2024 16:25:20 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 4/9] udf: Remove GFP_NOFS allocation in udf_expand_file_adinicb() Date: Tue, 23 Jan 2024 16:25:03 +0100 Message-Id: <20240123152520.4294-4-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=914; i=jack@suse.cz; h=from:subject; bh=RYcHNi+xKW7jK9A61eUsZ9qSxqKSTDlx6JYBz35Kcfk=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pPvhS/hzxWqf76meTP/IfQTuPd5gXityBVBIqn rtlTQSiJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aTwAKCRCcnaoHP2RA2TufCA CeFM8Jm3yJ57PVVuPPsizuwOaKOZ4I2beoBcmuX5dFk2GAO8RI2glKRPKOBBA4FysS1bWg6BPM2kc1 RaYvQm0I3xUbAzE3JFsz2jFviPJcHv8WhYniqZU5dEjUrOAptWomAdw6XsjhSCCN2WtyekR8G/HQlc mrnGHI7wrO4o9yH2qDi88RR3HzqFSkmGAR/vcj8uKIVNBcC1vxJ/8z8Vgqfkw3HJOLc15xDAIIpSLZ ND4ACUC2F/OHcEFMb5IYJgn5OYd+gLnNnPvoQalJKejKYsXYvIY+qnoCj9wg48WFOTAe9z2XHijnoT cL5BA3TqlYA8qBVAd6j+WN98W+BZBH X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: *** X-Spam-Score: 3.70 X-Spamd-Result: default: False [3.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO udf_expand_file_adinicb() is called under inode->i_rwsem and mapping->invalidate_lock. i_rwsem is safe wrt fs reclaim, invalidate_lock on this inode is safe as well (we hold inode reference so reclaim will not touch it, furthermore even lockdep should not complain as invalidate_lock is acquired from udf_evict_inode() only when truncating inode which should not happen from fs reclaim). Signed-off-by: Jan Kara --- fs/udf/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/inode.c b/fs/udf/inode.c index d8493449d4c5..2f831a3a91af 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -357,7 +357,7 @@ int udf_expand_file_adinicb(struct inode *inode) return 0; } - page = find_or_create_page(inode->i_mapping, 0, GFP_NOFS); + page = find_or_create_page(inode->i_mapping, 0, GFP_KERNEL); if (!page) return -ENOMEM; From patchwork Tue Jan 23 15:25:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527602 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 099795FDBA; Tue, 23 Jan 2024 15:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023532; cv=none; b=F9CUz9XQlF0G0sYQtS3faVOPUBqy7iRH875BBur1hiLTHnQ8gaJBbya4/VHPVwE8b+mQFrTUyOl1CcrjXzkRdHEqNMxSoWwo1x2KZ6gX93b+guhNynZw5QWoJWHt6HEqCBbmBYtIHbSFCMsr1rVy16tcF47+9+4SgxCzKluoAOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023532; c=relaxed/simple; bh=RMRnku4DuNfv2uoJ9TsdDQxPnVMzxFjKpiFLO1B2l0o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=t+R1liOyASrlSAlamsc6ihBmYEX/ldqqd2u+XI6nZXl9vRvJ3cN/oaeVeSq+mCu1hl0bZSNf6pey3u/gTSIrh1y3rtUweI+rzNoUCQLMqiR17UXntr6qf4Usp6TIoziGdZN/V7H8dOBTWxFErq6XNYL3BNDJqose6S+wNvmcwvo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Aw+gU7f2; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=5HIWDf39; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=Aw+gU7f2; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=5HIWDf39; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Aw+gU7f2"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="5HIWDf39"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="Aw+gU7f2"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="5HIWDf39" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0EBE6222D9; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VwCAMufR7GUSs9UGpUmAZb9QF/BRRq2SmaaN3jQUOuY=; b=Aw+gU7f2c3fhZRvNADuKp3PYCG35dfvLDe/z1npKj3u3n+y/kUAu4n962l2LGP8AZIZXk5 MWyD2IXHvDMC/CrYccGK5dyICZLTd+8QLencZVMAFzkzaLyl3XLKJJ9jkTlghPf2c8ss3r nK26ALNBmsn46pFl1erTrStnCx8XNPI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VwCAMufR7GUSs9UGpUmAZb9QF/BRRq2SmaaN3jQUOuY=; b=5HIWDf39oRhigExMDw9RVp/QM/SxxB2Ee0plOupxYA975EqgkvF0Raeog+uBpQpAmqS5eT HqqLiMkjUVCECxAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VwCAMufR7GUSs9UGpUmAZb9QF/BRRq2SmaaN3jQUOuY=; b=Aw+gU7f2c3fhZRvNADuKp3PYCG35dfvLDe/z1npKj3u3n+y/kUAu4n962l2LGP8AZIZXk5 MWyD2IXHvDMC/CrYccGK5dyICZLTd+8QLencZVMAFzkzaLyl3XLKJJ9jkTlghPf2c8ss3r nK26ALNBmsn46pFl1erTrStnCx8XNPI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VwCAMufR7GUSs9UGpUmAZb9QF/BRRq2SmaaN3jQUOuY=; b=5HIWDf39oRhigExMDw9RVp/QM/SxxB2Ee0plOupxYA975EqgkvF0Raeog+uBpQpAmqS5eT HqqLiMkjUVCECxAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F2CBD139B7; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id BQZIO2Xar2WsdQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id F0A9AA0809; Tue, 23 Jan 2024 16:25:20 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 5/9] ext2: Drop GFP_NOFS allocation from ext2_init_block_alloc_info() Date: Tue, 23 Jan 2024 16:25:04 +0100 Message-Id: <20240123152520.4294-5-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=813; i=jack@suse.cz; h=from:subject; bh=RMRnku4DuNfv2uoJ9TsdDQxPnVMzxFjKpiFLO1B2l0o=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pQJmDbkzCzGSmAMW0KWQi6FDNaYVtnGwXb4B6E HWHxX8yJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aUAAKCRCcnaoHP2RA2ctNB/ 0egt/sEM8nIS9SVaDlUOXhuOVW3S/6O2CWuLqFq1pW/ZEnANb8XtPX19CKyaU1J/m3OW6XgxRYnnz4 hMMs47xMuRaUsiQe2f5WADAezJQHd87BGdGxbaeUUGUvi+3SNGxqhfTKveutFu0le3R/Njmv7vAr7O AX4g2aLRSTcJuBz+MtW4M6cD7o2DbDULzicHTeqkXlPlrMuF3nxr9mA9I9sRVcW/I3f979uMNMXgHs KF9fGuIXgR7aZd/jfI+9sWrFw7u9UwM0o6AQc4CS0IFndZ7MeHOt/uVX1WbLsEaAi7aOfx0f20lniw 6dF/Le68v7bBTgyhn4jWc2pyuzn6rG X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Aw+gU7f2; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=5HIWDf39 X-Spamd-Result: default: False [4.69 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[35.87%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: 4.69 X-Rspamd-Queue-Id: 0EBE6222D9 X-Spam-Level: **** X-Spam-Flag: NO X-Spamd-Bar: ++++ The allocation happens under inode->i_rwsem and EXT2_I(inode)->i_truncate_mutex. Neither of them is acquired during direct fs reclaim so the allocation can be changed to GFP_KERNEL. Signed-off-by: Jan Kara --- fs/ext2/balloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index e124f3d709b2..1bfd6ab11038 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -412,7 +412,7 @@ void ext2_init_block_alloc_info(struct inode *inode) struct ext2_block_alloc_info *block_i; struct super_block *sb = inode->i_sb; - block_i = kmalloc(sizeof(*block_i), GFP_NOFS); + block_i = kmalloc(sizeof(*block_i), GFP_KERNEL); if (block_i) { struct ext2_reserve_window_node *rsv = &block_i->rsv_window_node; From patchwork Tue Jan 23 15:25:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527598 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 C12345FDB2; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; cv=none; b=RHCt8Zfj4a999GzxJ+V8v2YDksQ2KNh/aPMcnup+Qg4ElXfjJtGHI1/Z0fV2iS5hbIx/L0lOL2MZ/CCH3dgc1ZXHrLRUB1tpAX26Kf7/0ijbDJ1+oYYpsKZs+k8M8r8szHV5ySltNfEt/r6hiOW2RPc+mQ9XHOd4mne+8JmzXR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; c=relaxed/simple; bh=J6batrQ0krqqS6Fk9nHO3yuHQO2UEbFRTqBXwfpdoQM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QGoFIe60EULyyHGLiF944nNF6XWU2yEiBgye1GkO0Q0zXnuorI/xtHSgjHeNJrbDgz9n+kbNlXiV0Dw5wl2FTChVrWzw+xOMB/LQJWFeE0noX3w//HzQ1GsGD4C7s0zUSslVhqNIwdAPURdA0RoiK9RGLuJr+AA+l6UYwZvDHFE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=GI0xtpY4; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=4tISDxo2; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=GI0xtpY4; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=4tISDxo2; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="GI0xtpY4"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="4tISDxo2"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="GI0xtpY4"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="4tISDxo2" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 080D2222C8; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3YN/c637qj7Lt2r37Dh2rIefGzzIThCgolWTCRWesc=; b=GI0xtpY4Y3YSUiVHFPylw9enuHjR7fVot1pMtCCOkSqgNGi89ooC1hf7cga7gQ5UN8o8uy 8A8WuIFH3CjZmWcbNgz+t0cZcDdxpZIuzz5XLxSp0HnBSmZPWk+8o0Fzys6hABorLBS324 enMFxxewvtU6GEkmTnQOxVaY/VwcLdU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3YN/c637qj7Lt2r37Dh2rIefGzzIThCgolWTCRWesc=; b=4tISDxo2eJTyuLrJ/2fuBbjo9dqAKx9IouOLufi7YivppdXuxtkd6+JXZLUGeR1xsOMVm2 4RHJpGedBzd4ICBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3YN/c637qj7Lt2r37Dh2rIefGzzIThCgolWTCRWesc=; b=GI0xtpY4Y3YSUiVHFPylw9enuHjR7fVot1pMtCCOkSqgNGi89ooC1hf7cga7gQ5UN8o8uy 8A8WuIFH3CjZmWcbNgz+t0cZcDdxpZIuzz5XLxSp0HnBSmZPWk+8o0Fzys6hABorLBS324 enMFxxewvtU6GEkmTnQOxVaY/VwcLdU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k3YN/c637qj7Lt2r37Dh2rIefGzzIThCgolWTCRWesc=; b=4tISDxo2eJTyuLrJ/2fuBbjo9dqAKx9IouOLufi7YivppdXuxtkd6+JXZLUGeR1xsOMVm2 4RHJpGedBzd4ICBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EA867139B1; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id aS9FOWXar2WndQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 03C6CA080A; Tue, 23 Jan 2024 16:25:21 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 6/9] ext2: Drop GFP_NOFS use in ext2_get_blocks() Date: Tue, 23 Jan 2024 16:25:05 +0100 Message-Id: <20240123152520.4294-6-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=804; i=jack@suse.cz; h=from:subject; bh=J6batrQ0krqqS6Fk9nHO3yuHQO2UEbFRTqBXwfpdoQM=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pRcAJhWL9Yd1B4ryk1zgZ4/OuDFJah29KjD0Cj uWQkta+JATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aUQAKCRCcnaoHP2RA2S6WB/ 43NolxDby68EdfJk2yQZP275rtgSk3436SdWfUGLBYfUUGB7qnisVVtoevyP44Coj5wdy1pK7/uXbg raIXQ86LfHK0v6qxBcC/uxbpzxVA1pFxRs7jVGPjskRQREh4TBYPvIwMjAxIw5MgilCZndCbGW4Why 5g1sv2L8vTwq8mGzua+Kn3nERCC8tNzILv93SxlFpZ5iM2Yl0f9oJgvF40ILhJXRd8NjmY/NA9dH3H PUTO7XHC2DgFTmyjLosUDSEEuQegfA93hcMYCsSpOTWdRF+PSxtraj85ZscPAO84M8FzXpMFAuT03v ZYqQmbPLtm1kWkQvkP25M9uPq5N+8a X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[37.21%] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO ext2_get_blocks() calls sb_issue_zeroout() with GFP_NOFS flag. However the call is performed under inode->i_rwsem and EXT2_I(inode)->i_truncate_mutex neither of which is acquired during direct fs reclaim. So it is safe to change the gfp mask to GFP_KERNEL. Signed-off-by: Jan Kara --- fs/ext2/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 5a4272b2c6b0..f3d570a9302b 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -754,7 +754,7 @@ static int ext2_get_blocks(struct inode *inode, */ err = sb_issue_zeroout(inode->i_sb, le32_to_cpu(chain[depth-1].key), count, - GFP_NOFS); + GFP_KERNEL); if (err) { mutex_unlock(&ei->truncate_mutex); goto cleanup; From patchwork Tue Jan 23 15:25:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527601 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 C32585FDB9; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023530; cv=none; b=tU5x5j/umaWRxFmNNzYXHEXZFnl7aNsWA3Nkwpf/Ov+qImxo3pOV0MFeliJRAROajOTD5/o2AsgMkiDXQSaMmbjqOs8jcmsDQmYpkUiPpkvBFEAjAJpt8d1viDkbxO4QP6Cw9fw2lIBHDD2wueroEl+RVITvGO/XR4+dIHJtQ9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023530; c=relaxed/simple; bh=OKHJR3tq9xK6lVLxoUX8IKxN/+oDAVqLUCMYgc/ArKI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Tc5eLdTCV0T7sZ6BBSllAHq27bcbxOivaKVZ0g/UaF6+SBGZnxJ8AfFn6KkR8EyRktMzY8m3jco5vur6VGFQcb1UnjLAapNmT9Fo+zxNeGCYt/BGCmJO/H4oo7pB1G5wvRHrxAfpd/Pn4qrPjSthcUII9Ti6NS0X6etRc5/qEeA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=uHTBQTB5; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=B/gHf3xM; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=uHTBQTB5; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=B/gHf3xM; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="uHTBQTB5"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="B/gHf3xM"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="uHTBQTB5"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="B/gHf3xM" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 07FAA222C6; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xDTMyxuDw7UQAQM5IltrFCoGrv7T39YC9PjoJZhmavQ=; b=uHTBQTB5IvI/bT2grLqLnJYCWYqK2MiacXNqP10WKvGCqh6d4nqOY219BUmIyho3qUPazg IJko+/HYv6jnJyF+BNbZ/lv9YZuoQ16jQzI1mJAiKrvCm/djdopG2VoNG3mUIBesOBglFF BTCYS9IhJOz+JwvxWtPZYp1NfkyfnLI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xDTMyxuDw7UQAQM5IltrFCoGrv7T39YC9PjoJZhmavQ=; b=B/gHf3xMGjMeS1cDgPrmZ7jg4k1MSjZJ4pVMnVfIRWi74r3e+R5pktYmMGP0IzTRcQtWol BWBWroM8fSIf+pBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xDTMyxuDw7UQAQM5IltrFCoGrv7T39YC9PjoJZhmavQ=; b=uHTBQTB5IvI/bT2grLqLnJYCWYqK2MiacXNqP10WKvGCqh6d4nqOY219BUmIyho3qUPazg IJko+/HYv6jnJyF+BNbZ/lv9YZuoQ16jQzI1mJAiKrvCm/djdopG2VoNG3mUIBesOBglFF BTCYS9IhJOz+JwvxWtPZYp1NfkyfnLI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xDTMyxuDw7UQAQM5IltrFCoGrv7T39YC9PjoJZhmavQ=; b=B/gHf3xMGjMeS1cDgPrmZ7jg4k1MSjZJ4pVMnVfIRWi74r3e+R5pktYmMGP0IzTRcQtWol BWBWroM8fSIf+pBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EA80B136A4; Tue, 23 Jan 2024 15:25:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Srs9OWXar2WpdQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:25 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 0B228A080D; Tue, 23 Jan 2024 16:25:21 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 7/9] ext2: Remove GFP_NOFS use in ext2_xattr_cache_insert() Date: Tue, 23 Jan 2024 16:25:06 +0100 Message-Id: <20240123152520.4294-7-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=942; i=jack@suse.cz; h=from:subject; bh=OKHJR3tq9xK6lVLxoUX8IKxN/+oDAVqLUCMYgc/ArKI=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pSdUhT1gSyWpXx1ZVaMPxd9OupVSwqkmvE1ju4 0Fw0/4OJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aUgAKCRCcnaoHP2RA2VrZB/ 9wD/CcbNy1nHgAOWu7C3j3t08H+po6tn/cQdM5FWD4lIQcMScXv4fNrbyO+LG+pSG5LfCuDk1BQbzG YaEfkSvq6wwO0IKt7UTUBVGI6o/rtzYx9bq/QfkOTTsSWFhGNmZlnLFt7OCMPlhojlU1dLq82l60Gd TnlnU0a2caw8C+I1TdJyagc431K4eQkoWaKUoSWCtGqf1+w9CHrSvFglyU0I9cRpErVCkrcTuavmEb 32clkI5O2EpbC22j5D3Od70ZkOq8utQ1sDDzZTKeeXXPAXcqV0kQY+7G++dfzVP3fdoVY/N20DK6Ew KELlMaGygeXZAVN1lox0y/lcArL7Jo X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: ** X-Spam-Score: 2.88 X-Spamd-Result: default: False [2.88 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.82)[85.02%] X-Spam-Flag: NO ext2_xattr_cache_insert() calls mb_cache_entry_create() with GFP_NOFS because it is called under EXT2_I(inode)->xattr_sem. However xattr_sem or any higher ranking lock is not acquired on fs reclaim path for ext2 at least since we don't do page writeback from direct reclaim. Thus GFP_NOFS is not needed. Signed-off-by: Jan Kara --- fs/ext2/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index e849241ebb8f..c885dcc3bd0d 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -874,7 +874,7 @@ ext2_xattr_cache_insert(struct mb_cache *cache, struct buffer_head *bh) __u32 hash = le32_to_cpu(HDR(bh)->h_hash); int error; - error = mb_cache_entry_create(cache, GFP_NOFS, hash, bh->b_blocknr, + error = mb_cache_entry_create(cache, GFP_KERNEL, hash, bh->b_blocknr, true); if (error) { if (error == -EBUSY) { From patchwork Tue Jan 23 15:25:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527603 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 0994E5FDA8; Tue, 23 Jan 2024 15:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023533; cv=none; b=sapM0S33VNICf/SBfVvvEYc0oj6YsvuJixxmKShttXfuIza10geORqZDNJyDVkQGFye4qlkd9qS3lsiX6kAft9VHzy6HT8a6vk3hybZR/qu0XbKnCzuzfmHOCZQyLBmR/UbWqxY/0BbiPXG9VaIiVrE7xY0d+/i+7eeR+AdnHZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023533; c=relaxed/simple; bh=TA5BPdD0GKz3pUY1LakUIlXiQ3qA7movn4dWR/ip1iM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tatK9wqobnpomqNwQcIfXDOX6bzwFaHWUjcxywEt1fpsdW8EkVUrjztJNlnyqhkwquWV22Sr7d+Hd4vCO8FrJO7PUqd9uCjnwQU/Ufv5f9awvb4UhR808l4qA6ZbSoSCkLYqPq7ZL5Uj2yUy3iRdIzheL7wmwc7rkiRoh7i0eg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=QJDmpX/y; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=o40rHqGA; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=QJDmpX/y; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=o40rHqGA; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="QJDmpX/y"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="o40rHqGA"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="QJDmpX/y"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="o40rHqGA" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 151BD222DE; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXDxWbIvZOBQ+DKqskKrDxaYczxXIMvzmbB9x2BRSJI=; b=QJDmpX/yjyOahSqZwwCJ6wPUeRF6eXxitY3144zQqLoFMYnshjJ7RP5jcFzTBnZXv9RlfD JjXz81PVI4yk9Bjzypvhcf//XCHSWdRbZlvmdsmGiJ+9wVwDl7+IZW9EY8jyAIADyIEJNV PQtecP2R9GMQaquSHVF7cr3dvegOemw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXDxWbIvZOBQ+DKqskKrDxaYczxXIMvzmbB9x2BRSJI=; b=o40rHqGAqyZi0L+AEuHLtJKjZm+ZdEOWV+ZsB8J6pRW7UumMESNX84OgaiSbYtM7j19zUI 9678kbh41ZwoQcCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXDxWbIvZOBQ+DKqskKrDxaYczxXIMvzmbB9x2BRSJI=; b=QJDmpX/yjyOahSqZwwCJ6wPUeRF6eXxitY3144zQqLoFMYnshjJ7RP5jcFzTBnZXv9RlfD JjXz81PVI4yk9Bjzypvhcf//XCHSWdRbZlvmdsmGiJ+9wVwDl7+IZW9EY8jyAIADyIEJNV PQtecP2R9GMQaquSHVF7cr3dvegOemw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXDxWbIvZOBQ+DKqskKrDxaYczxXIMvzmbB9x2BRSJI=; b=o40rHqGAqyZi0L+AEuHLtJKjZm+ZdEOWV+ZsB8J6pRW7UumMESNX84OgaiSbYtM7j19zUI 9678kbh41ZwoQcCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 03243139CB; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SkvTAGbar2WudQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:26 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 12D61A080E; Tue, 23 Jan 2024 16:25:21 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 8/9] quota: Set nofs allocation context when acquiring dqio_sem Date: Tue, 23 Jan 2024 16:25:07 +0100 Message-Id: <20240123152520.4294-8-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=9902; i=jack@suse.cz; h=from:subject; bh=TA5BPdD0GKz3pUY1LakUIlXiQ3qA7movn4dWR/ip1iM=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pTvLxt8gGbGkEEgk/IB41mOrDBBMRm7kcSg0FE p+wZv8uJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aUwAKCRCcnaoHP2RA2S8GCA CVIHchAmr5+zfFF/eQ7jkkEX+gWRWlt+4Mk/Cg/PQ+DU7aFComhr8BP5q5XoFkhlHIlN9ibHZw37zC YwaTO9WKz7er/rZcRAvupSFToIGx1dJI3nUMOE40xGNJwYj+FQACB3n0ppf2NPhOPouaRedVhw+OgJ KCDelqpjpJkAjj21YfrvRENrYS44t+q7cjrypevYa0JBxV1dCjT3Yt4nq8/nqjW7+gCiJOeVX5cNWA j/qDUCuDGQFhNyMlg2J3UhsVnuFgl5nVycWC0YRZMrFVnpigaUtg9b8o+KlJbIKhMTr/G2MRieGBuE +DP1AokBH6cDQ/SQF2C0mnstWVrOKJ X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="QJDmpX/y"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=o40rHqGA X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.49 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Score: 0.49 X-Rspamd-Queue-Id: 151BD222DE X-Spam-Flag: NO dqio_sem can be acquired during inode reclaim through dquot_drop() -> dqput() -> dquot_release() -> write_file_info() context. In some cases (most notably through dquot_get_next_id()) it can be acquired without holding dquot->dq_lock (which already sets nofs allocation context). So we need to set nofs allocation context when acquiring it as well. Signed-off-by: Jan Kara --- fs/ocfs2/quota_global.c | 12 ++++++++++++ fs/ocfs2/quota_local.c | 3 +++ fs/quota/quota_v1.c | 6 ++++++ fs/quota/quota_v2.c | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index dc9f76ab7e13..0575c2d060eb 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -447,14 +447,17 @@ int ocfs2_global_write_info(struct super_block *sb, int type) int err; struct quota_info *dqopt = sb_dqopt(sb); struct ocfs2_mem_dqinfo *info = dqopt->info[type].dqi_priv; + unsigned int memalloc; down_write(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); err = ocfs2_qinfo_lock(info, 1); if (err < 0) goto out_sem; err = __ocfs2_global_write_info(sb, type); ocfs2_qinfo_unlock(info, 1); out_sem: + memalloc_nofs_restore(memalloc); up_write(&dqopt->dqio_sem); return err; } @@ -601,6 +604,7 @@ static int ocfs2_sync_dquot_helper(struct dquot *dquot, unsigned long type) struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; struct ocfs2_super *osb = OCFS2_SB(sb); int status = 0; + unsigned int memalloc; trace_ocfs2_sync_dquot_helper(from_kqid(&init_user_ns, dquot->dq_id), dquot->dq_id.type, @@ -618,6 +622,7 @@ static int ocfs2_sync_dquot_helper(struct dquot *dquot, unsigned long type) goto out_ilock; } down_write(&sb_dqopt(sb)->dqio_sem); + memalloc = memalloc_nofs_save(); status = ocfs2_sync_dquot(dquot); if (status < 0) mlog_errno(status); @@ -625,6 +630,7 @@ static int ocfs2_sync_dquot_helper(struct dquot *dquot, unsigned long type) status = ocfs2_local_write_dquot(dquot); if (status < 0) mlog_errno(status); + memalloc_nofs_restore(memalloc); up_write(&sb_dqopt(sb)->dqio_sem); ocfs2_commit_trans(osb, handle); out_ilock: @@ -662,6 +668,7 @@ static int ocfs2_write_dquot(struct dquot *dquot) handle_t *handle; struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb); int status = 0; + unsigned int memalloc; trace_ocfs2_write_dquot(from_kqid(&init_user_ns, dquot->dq_id), dquot->dq_id.type); @@ -673,7 +680,9 @@ static int ocfs2_write_dquot(struct dquot *dquot) goto out; } down_write(&sb_dqopt(dquot->dq_sb)->dqio_sem); + memalloc = memalloc_nofs_save(); status = ocfs2_local_write_dquot(dquot); + memalloc_nofs_restore(memalloc); up_write(&sb_dqopt(dquot->dq_sb)->dqio_sem); ocfs2_commit_trans(osb, handle); out: @@ -920,6 +929,7 @@ static int ocfs2_mark_dquot_dirty(struct dquot *dquot) struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; handle_t *handle; struct ocfs2_super *osb = OCFS2_SB(sb); + unsigned int memalloc; trace_ocfs2_mark_dquot_dirty(from_kqid(&init_user_ns, dquot->dq_id), type); @@ -946,6 +956,7 @@ static int ocfs2_mark_dquot_dirty(struct dquot *dquot) goto out_ilock; } down_write(&sb_dqopt(sb)->dqio_sem); + memalloc = memalloc_nofs_save(); status = ocfs2_sync_dquot(dquot); if (status < 0) { mlog_errno(status); @@ -954,6 +965,7 @@ static int ocfs2_mark_dquot_dirty(struct dquot *dquot) /* Now write updated local dquot structure */ status = ocfs2_local_write_dquot(dquot); out_dlock: + memalloc_nofs_restore(memalloc); up_write(&sb_dqopt(sb)->dqio_sem); ocfs2_commit_trans(osb, handle); out_ilock: diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index e09842fc9d4d..8ce462c64c51 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -470,6 +470,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, int bit, chunk; struct ocfs2_recovery_chunk *rchunk, *next; qsize_t spacechange, inodechange; + unsigned int memalloc; trace_ocfs2_recover_local_quota_file((unsigned long)lqinode->i_ino, type); @@ -521,6 +522,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, goto out_drop_lock; } down_write(&sb_dqopt(sb)->dqio_sem); + memalloc = memalloc_nofs_save(); spin_lock(&dquot->dq_dqb_lock); /* Add usage from quota entry into quota changes * of our node. Auxiliary variables are important @@ -553,6 +555,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, unlock_buffer(qbh); ocfs2_journal_dirty(handle, qbh); out_commit: + memalloc_nofs_restore(memalloc); up_write(&sb_dqopt(sb)->dqio_sem); ocfs2_commit_trans(OCFS2_SB(sb), handle); out_drop_lock: diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c index a0db3f195e95..3f3e8acc05db 100644 --- a/fs/quota/quota_v1.c +++ b/fs/quota/quota_v1.c @@ -160,9 +160,11 @@ static int v1_read_file_info(struct super_block *sb, int type) { struct quota_info *dqopt = sb_dqopt(sb); struct v1_disk_dqblk dqblk; + unsigned int memalloc; int ret; down_read(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); ret = sb->s_op->quota_read(sb, type, (char *)&dqblk, sizeof(struct v1_disk_dqblk), v1_dqoff(0)); if (ret != sizeof(struct v1_disk_dqblk)) { @@ -179,6 +181,7 @@ static int v1_read_file_info(struct super_block *sb, int type) dqopt->info[type].dqi_bgrace = dqblk.dqb_btime ? dqblk.dqb_btime : MAX_DQ_TIME; out: + memalloc_nofs_restore(memalloc); up_read(&dqopt->dqio_sem); return ret; } @@ -187,9 +190,11 @@ static int v1_write_file_info(struct super_block *sb, int type) { struct quota_info *dqopt = sb_dqopt(sb); struct v1_disk_dqblk dqblk; + unsigned int memalloc; int ret; down_write(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); ret = sb->s_op->quota_read(sb, type, (char *)&dqblk, sizeof(struct v1_disk_dqblk), v1_dqoff(0)); if (ret != sizeof(struct v1_disk_dqblk)) { @@ -209,6 +214,7 @@ static int v1_write_file_info(struct super_block *sb, int type) else if (ret >= 0) ret = -EIO; out: + memalloc_nofs_restore(memalloc); up_write(&dqopt->dqio_sem); return ret; } diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index ae99e7b88205..48e0d610ceef 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -96,9 +96,11 @@ static int v2_read_file_info(struct super_block *sb, int type) struct qtree_mem_dqinfo *qinfo; ssize_t size; unsigned int version; + unsigned int memalloc; int ret; down_read(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); ret = v2_read_header(sb, type, &dqhead); if (ret < 0) goto out; @@ -183,6 +185,7 @@ static int v2_read_file_info(struct super_block *sb, int type) info->dqi_priv = NULL; } out: + memalloc_nofs_restore(memalloc); up_read(&dqopt->dqio_sem); return ret; } @@ -195,8 +198,10 @@ static int v2_write_file_info(struct super_block *sb, int type) struct mem_dqinfo *info = &dqopt->info[type]; struct qtree_mem_dqinfo *qinfo = info->dqi_priv; ssize_t size; + unsigned int memalloc; down_write(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); spin_lock(&dq_data_lock); info->dqi_flags &= ~DQF_INFO_DIRTY; dinfo.dqi_bgrace = cpu_to_le32(info->dqi_bgrace); @@ -209,6 +214,7 @@ static int v2_write_file_info(struct super_block *sb, int type) dinfo.dqi_free_entry = cpu_to_le32(qinfo->dqi_free_entry); size = sb->s_op->quota_write(sb, type, (char *)&dinfo, sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); + memalloc_nofs_restore(memalloc); up_write(&dqopt->dqio_sem); if (size != sizeof(struct v2_disk_dqinfo)) { quota_error(sb, "Can't write info structure"); @@ -328,11 +334,14 @@ static int v2_read_dquot(struct dquot *dquot) { struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); int ret; + unsigned int memalloc; down_read(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); ret = qtree_read_dquot( sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot); + memalloc_nofs_restore(memalloc); up_read(&dqopt->dqio_sem); return ret; } @@ -342,6 +351,7 @@ static int v2_write_dquot(struct dquot *dquot) struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); int ret; bool alloc = false; + unsigned int memalloc; /* * If space for dquot is already allocated, we don't need any @@ -355,9 +365,11 @@ static int v2_write_dquot(struct dquot *dquot) } else { down_read(&dqopt->dqio_sem); } + memalloc = memalloc_nofs_save(); ret = qtree_write_dquot( sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot); + memalloc_nofs_restore(memalloc); if (alloc) up_write(&dqopt->dqio_sem); else @@ -368,10 +380,13 @@ static int v2_write_dquot(struct dquot *dquot) static int v2_release_dquot(struct dquot *dquot) { struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); + unsigned int memalloc; int ret; down_write(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); ret = qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot); + memalloc_nofs_restore(memalloc); up_write(&dqopt->dqio_sem); return ret; @@ -386,10 +401,13 @@ static int v2_free_file_info(struct super_block *sb, int type) static int v2_get_next_id(struct super_block *sb, struct kqid *qid) { struct quota_info *dqopt = sb_dqopt(sb); + unsigned int memalloc; int ret; down_read(&dqopt->dqio_sem); + memalloc = memalloc_nofs_save(); ret = qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid); + memalloc_nofs_restore(memalloc); up_read(&dqopt->dqio_sem); return ret; } From patchwork Tue Jan 23 15:25:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13527599 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 DE6955FDBA; Tue, 23 Jan 2024 15:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; cv=none; b=EZnIsRYZrofPtdA2cvHV/tYtB2b3gLLGcUqHUnIBsXVFm9LM1v2hMQEF+8PbD1Cazr5EyN3aPfIiSKZLjTUdeD2xMqyA7PAjdqoj6/PCeDSu2DynDRMI5YuBFHOnQL4FU/KnezTmXyvwxQ06Lj9Qdg2P9vGOJhE75N0ZCC5hY/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706023529; c=relaxed/simple; bh=YBiQ8/ge7B0Cy2nRMqM5Ufe9ziq5MOCh7BlnVIaFXDk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VS6PKEP4ZD7E7HcNqiv9stlTtV0bHxRjrYrE/iZr5YksNWcr0XFyj9L6Qvjp219KYoUVafeuTDYhOrJQz6OI1MuUSJZqMUCNNuWQjlaljcbA/5zbkR34AuF48WGhgEq43eWcfqddvID52qwK5nvljlTs8nejEYzO1VpbDaY7qmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=sB2l91+F; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=9HvmEOsb; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=sB2l91+F; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=9HvmEOsb; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="sB2l91+F"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="9HvmEOsb"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="sB2l91+F"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="9HvmEOsb" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 11AFC1FD81; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z8WIyV3lKxgxbFCSvhGPHax9kDia3vCA/+e3zP7Jyq4=; b=sB2l91+FuTVjeyed8qpaEwKM2Rdb/yYqLC2wrEHxiEkIcHEHcBwdvYQIzG7jrtwWKbXbjs pM3bA0hJH3hRTvrN3W6dwN8NXWta6ScVrhHsOe95Lcf0jp6P1AOQkeIVcxv616d11xqIZW XqhDlDxfrjGQJS2K48YvYzWucGst44M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z8WIyV3lKxgxbFCSvhGPHax9kDia3vCA/+e3zP7Jyq4=; b=9HvmEOsbCvYRS3RvBN2XOVmNZJihYSpanBdQw6KuPE0/DlRiUlNQQdPIRJKbsBOjZkoXKW lkaHk1w5WTv3eMCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z8WIyV3lKxgxbFCSvhGPHax9kDia3vCA/+e3zP7Jyq4=; b=sB2l91+FuTVjeyed8qpaEwKM2Rdb/yYqLC2wrEHxiEkIcHEHcBwdvYQIzG7jrtwWKbXbjs pM3bA0hJH3hRTvrN3W6dwN8NXWta6ScVrhHsOe95Lcf0jp6P1AOQkeIVcxv616d11xqIZW XqhDlDxfrjGQJS2K48YvYzWucGst44M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706023526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z8WIyV3lKxgxbFCSvhGPHax9kDia3vCA/+e3zP7Jyq4=; b=9HvmEOsbCvYRS3RvBN2XOVmNZJihYSpanBdQw6KuPE0/DlRiUlNQQdPIRJKbsBOjZkoXKW lkaHk1w5WTv3eMCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 013D0139B9; Tue, 23 Jan 2024 15:25:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id zVtPAGbar2WtdQAAD6G6ig (envelope-from ); Tue, 23 Jan 2024 15:25:26 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 1AC11A080F; Tue, 23 Jan 2024 16:25:21 +0100 (CET) From: Jan Kara To: Cc: , Matthew Wilcox , Jan Kara Subject: [PATCH 9/9] quota: Drop GFP_NOFS instances under dquot->dq_lock and dqio_sem Date: Tue, 23 Jan 2024 16:25:08 +0100 Message-Id: <20240123152520.4294-9-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240123152113.13352-1-jack@suse.cz> References: <20240123152113.13352-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5634; i=jack@suse.cz; h=from:subject; bh=YBiQ8/ge7B0Cy2nRMqM5Ufe9ziq5MOCh7BlnVIaFXDk=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBlr9pTqJyC9l3eERdlefPakLL+cFswto4FqJf/5rH7 7lR804iJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZa/aUwAKCRCcnaoHP2RA2XhMB/ 9oRJZmPqwsfDmk+ssiShGGcBKNORJNFlqiGbwaRUBBgowKps7UpxF/GodL6ZIV2/8qkiPq1VJIl3yX jXPT29jQMrAlkNaMubA9IMhjBble01hHDydt3G06+iBr6qdsSZgYpPc13e8H1YWt2DWKX7ZiXDfo7Z 0ou47UWkV+nQtl3UumRFVgplUcoEWPy+oXBrZMVtC7gOsZhvMQRlNNY+QfXTl1G9ke0Tx7Sb+6SHMN dV80KrdRSXeYDdu/U+cBHbmehAu8z1pGtJFicY5luNT4RYdi8sEQaqlXqgdsTKALvSC2oKEq25LPni d4UgWv8Z5S6bn4rJ0qdd9n27kcRtEw X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: 0.70 X-Spamd-Result: default: False [0.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Flag: NO Quota code acquires dquot->dq_lock whenever reading / writing dquot. When reading / writing quota info we hold dqio_sem. Since these locks can be acquired during inode reclaim (through dquot_drop() -> dqput() -> dquot_release()) we are setting nofs allocation context whenever acquiring these locks. Hence there's no need to use GFP_NOFS allocations in quota code doing IO. Just switch it to GFP_KERNEL. Signed-off-by: Jan Kara --- fs/quota/quota_tree.c | 24 ++++++++++++------------ fs/quota/quota_v2.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c index 0f1493e0f6d0..ef0461542d3a 100644 --- a/fs/quota/quota_tree.c +++ b/fs/quota/quota_tree.c @@ -108,7 +108,7 @@ static int check_dquot_block_header(struct qtree_mem_dqinfo *info, /* Remove empty block from list and return it */ static int get_free_dqblk(struct qtree_mem_dqinfo *info) { - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; int ret, blk; @@ -160,7 +160,7 @@ static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk) static int remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf, uint blk) { - char *tmpbuf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *tmpbuf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; uint nextblk = le32_to_cpu(dh->dqdh_next_free); uint prevblk = le32_to_cpu(dh->dqdh_prev_free); @@ -207,7 +207,7 @@ static int remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf, static int insert_free_dqentry(struct qtree_mem_dqinfo *info, char *buf, uint blk) { - char *tmpbuf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *tmpbuf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; int err; @@ -255,7 +255,7 @@ static uint find_free_dqentry(struct qtree_mem_dqinfo *info, { uint blk, i; struct qt_disk_dqdbheader *dh; - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); char *ddquot; *err = 0; @@ -329,7 +329,7 @@ static uint find_free_dqentry(struct qtree_mem_dqinfo *info, static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint *treeblk, int depth) { - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); int ret = 0, newson = 0, newact = 0; __le32 *ref; uint newblk; @@ -410,7 +410,7 @@ int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) int type = dquot->dq_id.type; struct super_block *sb = dquot->dq_sb; ssize_t ret; - char *ddquot = kmalloc(info->dqi_entry_size, GFP_NOFS); + char *ddquot = kmalloc(info->dqi_entry_size, GFP_KERNEL); if (!ddquot) return -ENOMEM; @@ -449,7 +449,7 @@ static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint blk) { struct qt_disk_dqdbheader *dh; - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); int ret = 0; if (!buf) @@ -513,7 +513,7 @@ static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, static int remove_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint *blk, int depth) { - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); int ret = 0; uint newblk; __le32 *ref = (__le32 *)buf; @@ -577,7 +577,7 @@ EXPORT_SYMBOL(qtree_delete_dquot); static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint blk) { - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); loff_t ret = 0; int i; char *ddquot; @@ -615,7 +615,7 @@ static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info, static loff_t find_tree_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, uint blk, int depth) { - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); loff_t ret = 0; __le32 *ref = (__le32 *)buf; @@ -684,7 +684,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) } dquot->dq_off = offset; } - ddquot = kmalloc(info->dqi_entry_size, GFP_NOFS); + ddquot = kmalloc(info->dqi_entry_size, GFP_KERNEL); if (!ddquot) return -ENOMEM; ret = sb->s_op->quota_read(sb, type, ddquot, info->dqi_entry_size, @@ -728,7 +728,7 @@ EXPORT_SYMBOL(qtree_release_dquot); static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id, unsigned int blk, int depth) { - char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS); + char *buf = kmalloc(info->dqi_usable_bs, GFP_KERNEL); __le32 *ref = (__le32 *)buf; ssize_t ret; unsigned int epb = info->dqi_usable_bs >> 2; diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index 48e0d610ceef..5eb0de8e7e40 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -121,7 +121,7 @@ static int v2_read_file_info(struct super_block *sb, int type) ret = -EIO; goto out; } - info->dqi_priv = kmalloc(sizeof(struct qtree_mem_dqinfo), GFP_NOFS); + info->dqi_priv = kmalloc(sizeof(struct qtree_mem_dqinfo), GFP_KERNEL); if (!info->dqi_priv) { ret = -ENOMEM; goto out;