The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Hongling Zeng <zhongling0719@126.com>
To: Dominique Martinet <asmadeus@codewreck.org>,
	 Hongling Zeng <zenghongling@kylinos.cn>
Cc: ericvh@kernel.org, lucho@ionkov.net, linux_oss@crudebyte.com,
	 v9fs@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] 9p: Fix mkdir to return NULL on success
Date: Wed, 20 May 2026 09:42:53 +0800	[thread overview]
Message-ID: <6A0D119D.3070900@126.com> (raw)
In-Reply-To: <agxVvu6on5BXqb2J@codewreck.org>

  Hi Dominique,

   Thanks for picking this up!

   I received David feedback suggesting to simplify v9fs_vfs_mkdir()
   by removing the 'err' variable and using ERR_CAST(). Since v1 is
   already merged, would you still like a v2, or shall I submit it 
separately?

   Best regards,
   Hongling
在 2026年05月19日 20:21, Dominique Martinet 写道:
> Hongling Zeng wrote on Mon, May 11, 2026 at 02:18:30PM +0800:
>> When mkdir succeeds, v9fs_vfs_mkdir_dotl() and v9fs_vfs_mkdir() return
>> ERR_PTR(0) which is incorrect. They should return NULL instead for
>> success and ERR_PTR() only with negative error codes for failure.
>>
>> Return NULL instead of passing to ERR_PTR while err is zero
>> Fixes smatch warnings:
>>    fs/9p/vfs_inode_dotl.c:420 v9fs_vfs_mkdir_dotl() warn: passing zero to 'ERR_PTR'
>>    fs/9p/vfs_inode.c:695 v9fs_vfs_mkdir() warn: passing zero to 'ERR_PTR'
>>
>> This change does not alter the runtime behavior since ERR_PTR(0) and NULL
>> are equivalent. However, it improves code readability and silences static
>> analyzer warnings.
>>
>> Fixes: 88d5baf69082 ("Change inode_operations.mkdir to return struct dentry *")
>> Acked-by: Christian Schoenebeck <linux_oss@crudebyte.com>
>> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> Thanks, I've picked this up with s/Fix/make/ in the commit subject, as I
> (subjectively) don't consider this a fix given it's only a style change
>


  reply	other threads:[~2026-05-20  1:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  6:18 [PATCH v1] 9p: Fix mkdir to return NULL on success Hongling Zeng
2026-05-19 12:21 ` Dominique Martinet
2026-05-20  1:42   ` Hongling Zeng [this message]
2026-05-20  1:59     ` Dominique Martinet
2026-05-19 17:35 ` David Laight
2026-05-20  1:24   ` Hongling Zeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6A0D119D.3070900@126.com \
    --to=zhongling0719@126.com \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=v9fs@lists.linux.dev \
    --cc=zenghongling@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox