From patchwork Mon Nov 11 22:10:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdul Rahim X-Patchwork-Id: 13871449 Received: from sonic312-20.consmr.mail.sg3.yahoo.com (sonic312-20.consmr.mail.sg3.yahoo.com [106.10.244.210]) (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 BBA8C158D8B for ; Mon, 11 Nov 2024 23:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=106.10.244.210 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731366093; cv=none; b=AbVF9LZiwzFL7WEof+frUqpVfDzWlmvwRTA6RNUW5WeMR8gJt7zxxcXYgMDjz6iuTK/P4VSb2eqWc5vDoKef3IXme7H0vkL8B+cGw7W9b+YW9hTSzpZBqDdme890pMfGXE0LU2eZ+GwiQyugck6Fy3/I1bmpkcwbtRQ/vb6k6ZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731366093; c=relaxed/simple; bh=cG7reSJoypxhSF8WZxlnJTDYEnJc2ocW1SAjGk4F16Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:References; b=sMw7zXoIfAplBrahu4T5ip8QBnOlibbZAL8qlDfpgBOGb74/+bBhPS/WS9hIW8wKkiKCzjOjRw/1vHxIkC+QOT/9NKI8zhHwGF7FjMQ8fvm/4nYdB3ob6vc0R0Vn9xeCvBgSkfSAiNnUnKrYy3k4xX1iQiZjDGXod8BHLFZl9ZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com; spf=pass smtp.mailfrom=myyahoo.com; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b=AEb6De3e; arc=none smtp.client-ip=106.10.244.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b="AEb6De3e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myyahoo.com; s=s2048; t=1731366085; bh=VAY3jISqxsGqhWsIMu+XZ8jzanX+gBt2aTfBTDDEbuQ=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=AEb6De3euIYUsDYPQFVErxUKQgP0DlKMx3LArR0KXaQBurpgpW6ecyJ2ZpEwP4BJZ54iduOTyZwMUPUyuLPjFRB5PloseegN2/VtWXI2FT4SkwwSq5MkV80m1+bZSBgTgT9fggwIgEPHL7lEnYaj9Y1oFifW9wPmuHv0wl12tQO2rgy/l9lKio86USsjxl+tK9BviAvXEMkreWRtHnqkTQBYyZMI434gPunyiOBhHFOzzKXtaipSR9ong11dtN0UiX54YWv5WSdCB+ueWhtT70KiW4k2KKz8fX8uum14ff+Gu/Q+ZaHu0yCln9c13mF73EGnq11XQVzNSpJtzm43Nw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1731366085; bh=2ShWKdwrlFy6U3cnI/bUiZsuToNmwBsJNu1Z4iWqffV=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=f/tjklWYOM0IKgWIZRiEhODKWJ/vVPZ5Q4kuBPmhOeGwP8hWTmhdEX9s5q6cOMTicIEJO8fteJS3ykb8lArZ5WseRk1Gsr1aVSIUrWqztlWtw5Y3FJHR/M++SuDXKdM6UeZDq8VTue4T/N7B8/jzldOaqdLqtwnEgvwCnY6a67S4CRgMgutGnjwAsPDmumHmgzJvFyG46okFzUNH08I94Fd8Klv3JzHDYXwMoESKNLSUM3M+1pyfql7a+QjTf7pPey7tD5XV2Gle3O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KMo47vtnitPiLIR1kYa_SFQ1skqjwDLTYeHNkUjbLMmbiPcNMuwpX FNx3Ci6ecvyGY2RsIR7Z7fHj7s2okUcLvT4_OLLV.d67.6jfczVARqJMngm7ka4djPno5vl74ORl SAV_eRUjqknaAqEPgryiQLa36GAVfS6NicCrpDt.U5w5OyevKtYvrCl6u83udOPsQf1gsA1aRJVc evk236WmJm0LdqzN_xHWWFFN9g0vSubQLeyKoUXFt1Ru2XxX3B8VQHME- X-Sonic-MF: X-Sonic-ID: 3f86b400-b84b-40d7-bc51-9595ddb8a81e Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.sg3.yahoo.com with HTTP; Mon, 11 Nov 2024 23:01:25 +0000 Received: by hermes--production-sg3-5b7954b588-f8smd (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7fa1234fe99fc0a71fe48f5ec805f6a6; Mon, 11 Nov 2024 22:10:42 +0000 (UTC) From: Abdul Rahim To: xiubli@redhat.com, idryomov@gmail.com Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Abdul Rahim Subject: [PATCH] Use strscpy() instead of strcpy() Date: Tue, 12 Nov 2024 03:40:37 +0530 Message-ID: <20241111221037.92853-1-abdul.rahim@myyahoo.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241111221037.92853-1-abdul.rahim.ref@myyahoo.com> strcpy() is generally considered unsafe and use of strscpy() is recommended [1] this fixes checkpatch warning: WARNING: Prefer strscpy over strcpy Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Abdul Rahim --- fs/ceph/export.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 44451749c544..0e5b3c7b3756 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c @@ -452,7 +452,7 @@ static int __get_snap_name(struct dentry *parent, char *name, goto out; if (ceph_snap(inode) == CEPH_SNAPDIR) { if (ceph_snap(dir) == CEPH_NOSNAP) { - strcpy(name, fsc->mount_options->snapdir_name); + strscpy(name, fsc->mount_options->snapdir_name); err = 0; } goto out;