From patchwork Mon May 20 09:08:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fedor Pchelkin X-Patchwork-Id: 13668136 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43A68208A0; Mon, 20 May 2024 09:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716196213; cv=none; b=U1nYfwB642mM0eCzjALpHOZRY2gUXZChwyEVk1AZO5WYiOHVz55nILxlzKJE6sLQpmaiAhpmEdZNoN+tc4ZwgK3+CPkcCqX+jP+F9xy0ntjSH/Q8stqJvKn+7uyI846fw6dKyYtL7zkTum6wmOqUhTP5uULdkUkMenagT2Iy2Do= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716196213; c=relaxed/simple; bh=545Z9tkN34N0Dsh1Q1qIJ26oe7owU6dG5nZ3IvZTHz4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UzQi+WamN/WOHJhNfVvZcm8vpuqsofZJF26ktCLec0ZLvlUNEwxjiSFNpFwHIaz5Q6arjEiWulBrOe0eTQyz103D0B3tbfb1DLImGRrGMrUffbh5Jlu4z89sga6RDPSdDLS1sfmRsd9ZyWRaeWxDDGQIfYA8o7d5pavvneIoPqk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=VX1XD5fH; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="VX1XD5fH" Received: from localhost.localdomain (unknown [5.228.116.47]) by mail.ispras.ru (Postfix) with ESMTPSA id 1046C407853B; Mon, 20 May 2024 09:10:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 1046C407853B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1716196201; bh=ITagZGQ3VHzpt1AUxt0LwozxAebgPmFLksDrhcMgLC8=; h=From:To:Cc:Subject:Date:From; b=VX1XD5fHx8v2bAF4FE179K/dueE5KZaWO5YqetmsajbMQTTHnHcsB1v2Y7OE1vsL5 RmH+FDOFJzdssBBoXv8Lz8IgsqQrVp71nBMfZFZr88CNq36dqUPV2Cp8ANun0wKtCp W7U8qCNUesiy1syEDlUVMWeIqi2wJPSw72t4xqcA= From: Fedor Pchelkin To: Jens Axboe , Christian Brauner Cc: Fedor Pchelkin , Alexander Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: [PATCH 1/2] signalfd: fix error return code Date: Mon, 20 May 2024 12:08:18 +0300 Message-Id: <20240520090819.76342-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If anon_inode_getfile() fails, return appropriate error code. This looks like a single typo: the similar code changes in timerfd and userfaultfd are okay. Found by Linux Verification Center (linuxtesting.org). Fixes: fbe38120eb1d ("signalfd: convert to ->read_iter()") Signed-off-by: Fedor Pchelkin Reviewed-by: Jens Axboe --- fs/signalfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 4a5614442dbf..65fe5eed0be4 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -282,7 +282,7 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags) if (IS_ERR(file)) { put_unused_fd(ufd); kfree(ctx); - return ufd; + return PTR_ERR(file); } file->f_mode |= FMODE_NOWAIT; From patchwork Mon May 20 09:08:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fedor Pchelkin X-Patchwork-Id: 13668137 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E67B817582; Mon, 20 May 2024 09:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716196214; cv=none; b=eIUgVAzOcqhi1fGXDurskFaFdU2Pgdr3I3xF40FoBNV4d7A9Qz5RErJggpSFt15u04J3AviorvNrXaTMECvHFyoP700QrUwPNnQDjKlmvLXCHD3uRDa/lrjRkydrjBrkiX+rblgOGs9chATjMOjS11/PM9o+SOsTM4r/RDBRJIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716196214; c=relaxed/simple; bh=QMnAxaPzlL4eiJg04ZbAkcZo0hqXo9HoK8/+LMpK6qg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eCkpl7MprGYdY/lojSNSshA2+jppud95xjLYt62agdVd4IYBSC1DqUTYgYaFFcrzts0A+ORIWOhSBW9C2ayI/Qfdq24vK1W4KUGYCqayU6lIKeQ4fPMcNQqvrXE1C+rOfjLj+oSjR8jP7sjmRW4KSRBLHxCkfXyPw7ZvADpU7rA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=tltHW9Et; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="tltHW9Et" Received: from localhost.localdomain (unknown [5.228.116.47]) by mail.ispras.ru (Postfix) with ESMTPSA id 0AD8C40205B8; Mon, 20 May 2024 09:10:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 0AD8C40205B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1716196203; bh=cIAuQ05HL8dT+YuU57b7ICw2uMbJEDIVKdXTJG1CATY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tltHW9EtPDxPvt24ND6x0Rzcl8xX/NKIxbyf05UH5YVZKO+rFby8gSmx+VlIVeHtI wnk6E5Lauv0HPtGmz51Xt7sOfP1XLptCOKCau34id8oSdvd/v7ji20VlYt3iwF4Gje Y4YZHZJhpqzujxD3BXypeTr4fxJNRGNhkDSxyy/I= From: Fedor Pchelkin To: Jens Axboe , Christian Brauner Cc: Fedor Pchelkin , Alexander Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: [PATCH 2/2] signalfd: drop an obsolete comment Date: Mon, 20 May 2024 12:08:19 +0300 Message-Id: <20240520090819.76342-2-pchelkin@ispras.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240520090819.76342-1-pchelkin@ispras.ru> References: <20240520090819.76342-1-pchelkin@ispras.ru> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit fbe38120eb1d ("signalfd: convert to ->read_iter()") removed the call to anon_inode_getfd() by splitting fd setup into two parts. Drop the comment referencing the internal details of that function. Signed-off-by: Fedor Pchelkin Reviewed-by: Jens Axboe --- fs/signalfd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/signalfd.c b/fs/signalfd.c index 65fe5eed0be4..ec7b2da2477a 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -286,10 +286,6 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags) } file->f_mode |= FMODE_NOWAIT; - /* - * When we call this, the initialization must be complete, since - * anon_inode_getfd() will install the fd. - */ fd_install(ufd, file); } else { struct fd f = fdget(ufd);