get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2222231/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2222231,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222231/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260410232055.1582463-1-pc@manguebit.org/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/12/?format=api",
        "name": "Linux CIFS Client",
        "link_name": "linux-cifs-client",
        "list_id": "linux-cifs.vger.kernel.org",
        "list_email": "linux-cifs@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260410232055.1582463-1-pc@manguebit.org>",
    "date": "2026-04-10T23:20:55",
    "name": "smb: client: get rid of d_drop()+d_add()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4e58b0dd3b7ba8416915f6cabf298d5b01b59f2f",
    "submitter": {
        "id": 91025,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/91025/?format=api",
        "name": "Paulo Alcantara",
        "email": "pc@manguebit.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260410232055.1582463-1-pc@manguebit.org/mbox/",
    "series": [
        {
            "id": 499516,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499516/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499516",
            "date": "2026-04-10T23:20:55",
            "name": "smb: client: get rid of d_drop()+d_add()",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499516/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222231/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222231/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10755-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-cifs@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=manguebit.org header.i=@manguebit.org header.a=rsa-sha256\n header.s=dkim header.b=IDFZeIu8;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10755-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=manguebit.org header.i=@manguebit.org\n header.b=\"IDFZeIu8\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=143.255.12.172",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=manguebit.org",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=manguebit.org"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fst8f5c2Wz1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 09:21:06 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id E4F053028EA1\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 23:21:03 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AB3B4336ECF;\n\tFri, 10 Apr 2026 23:21:01 +0000 (UTC)",
            "from mx1.manguebit.org (mx1.manguebit.org [143.255.12.172])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 13A9578F4F;\n\tFri, 10 Apr 2026 23:20:59 +0000 (UTC)",
            "from pc by mx1.manguebit.org with local (Exim 4.99.1)\n\tid 1wBL9k-00000002aTc-0MMA;\n\tFri, 10 Apr 2026 20:20:56 -0300"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775863261; cv=none;\n b=gum/5uhSv7EXfVSUnMh6mjPfu4YQJr5irUaMO2CHDel4gjHHcLeJoh1SH/lTust6AMKNcPLqFbdp3LF8wnNY0BbZwukA78GeU936Z0LJT8hGceBIWm0Q4930i0AqZG0jGwh+Mr7Gty9t43Y+buKE6XeaYP2sn8xsK/cJfwNM/zY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775863261; c=relaxed/simple;\n\tbh=xLYMJsZb9IzyVX8l8/n9T3eevmN2NNElKg+5QWW6LjI=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=ScNahaThFuZ+kkU+0JXm02VML8GM8o8GVDGjEZuhzGAc9cDsVWG1QCJ4H9irHi2kftR88d+CTD+VeAx1zk8VU+EvJUb6gggEy3vad3vpcTCVfcO8o9xfKtKcXQzG/Qhd3KPAEc3Ny0MHHPZOX8Lr5l/m0fyviWJZaO+40Y9dpeE=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=manguebit.org;\n spf=pass smtp.mailfrom=manguebit.org;\n dkim=pass (2048-bit key) header.d=manguebit.org header.i=@manguebit.org\n header.b=IDFZeIu8; arc=none smtp.client-ip=143.255.12.172",
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=manguebit.org; s=dkim; h=Content-Transfer-Encoding:MIME-Version:Message-ID:\n\tDate:Subject:Cc:To:From:Sender:Content-Type:Reply-To:Content-ID:\n\tContent-Description:In-Reply-To:References;\n\tbh=pxwfcnC1ooZ01QHTltFOb/7v1rFhrgwsQWkVgNQtSxM=; b=IDFZeIu8u1O5uINakARi2UE7Lw\n\tXhtIsWqEKqnTOCWCMk7t9YNLPV8t9tkYWyPvajtQYhFXhjC0G13NAbYo5LGeUHG+OZq4tcylv4n23\n\t2Omolsb3rX/EXLusypZ+BQNdcxfpXWZkAo8rbUdFbaJp+2xaN0UuD0fcrnKCPwOoWSedOc2oVy8NT\n\ti0cVvlK6wS0gwJnXAhlUJ5bRUxZIjWSYRd3bqcb9Iy/wjws8hs1TfLJ/rbUPX+dFzotSmeivmjbb/\n\t2hY8Tk25GPFzBwitETQo0Tl9jeRZRYpgieI9TSMWG+vQJBR88CaD4e/33iT+I7H6KDSI5tcpQVasm\n\tbHcsKa6Q==;",
        "From": "Paulo Alcantara <pc@manguebit.org>",
        "To": "smfrench@gmail.com",
        "Cc": "Al Viro <viro@zeniv.linux.org.uk>,\n\t\"Paulo Alcantara (Red Hat)\" <pc@manguebit.org>,\n\tDavid Howells <dhowells@redhat.com>,\n\tNeilBrown <neilb@ownmail.net>,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-cifs@vger.kernel.org",
        "Subject": "[PATCH] smb: client: get rid of d_drop()+d_add()",
        "Date": "Fri, 10 Apr 2026 20:20:55 -0300",
        "Message-ID": "<20260410232055.1582463-1-pc@manguebit.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-cifs@vger.kernel.org",
        "List-Id": "<linux-cifs.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "Replace d_drop()+d_add() in cifs_tmpfile() and cifs_create() with\nd_instantiate(), and in cifs_atomic_open() with d_splice_alias() if\nin-lookup, otherwise d_instantiate().\n\nReported-by: Al Viro <viro@zeniv.linux.org.uk>\nCloses: https://lore.kernel.org/r/20260408065719.GF3836593@ZenIV\nSigned-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>\nCc: David Howells <dhowells@redhat.com>\nCc: NeilBrown <neilb@ownmail.net>\nCc: linux-fsdevel@vger.kernel.org\nCc: linux-cifs@vger.kernel.org\n---\n fs/smb/client/cifsfs.h |  4 +--\n fs/smb/client/dir.c    | 62 ++++++++++++++++++++++++++----------------\n 2 files changed, 40 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/fs/smb/client/cifsfs.h b/fs/smb/client/cifsfs.h\nindex 64c7a4c6ac83..18f9f93a01b4 100644\n--- a/fs/smb/client/cifsfs.h\n+++ b/fs/smb/client/cifsfs.h\n@@ -52,9 +52,9 @@ void cifs_sb_deactive(struct super_block *sb);\n /* Functions related to inodes */\n extern const struct inode_operations cifs_dir_inode_ops;\n struct inode *cifs_root_iget(struct super_block *sb);\n-int cifs_create(struct mnt_idmap *idmap, struct inode *inode,\n+int cifs_create(struct mnt_idmap *idmap, struct inode *dir,\n \t\tstruct dentry *direntry, umode_t mode, bool excl);\n-int cifs_atomic_open(struct inode *inode, struct dentry *direntry,\n+int cifs_atomic_open(struct inode *dir, struct dentry *direntry,\n \t\t     struct file *file, unsigned int oflags, umode_t mode);\n int cifs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,\n \t\t struct file *file, umode_t mode);\ndiff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c\nindex bfc887d506b6..6ea1ae7f7a46 100644\n--- a/fs/smb/client/dir.c\n+++ b/fs/smb/client/dir.c\n@@ -219,6 +219,7 @@ static int __cifs_do_create(struct inode *dir, struct dentry *direntry,\n \tint rdwr_for_fscache = 0;\n \t__le32 lease_flags = 0;\n \n+\t*inode = NULL;\n \t*oplock = 0;\n \tif (tcon->ses->server->oplocks)\n \t\t*oplock = REQ_OPLOCK;\n@@ -462,7 +463,6 @@ static int __cifs_do_create(struct inode *dir, struct dentry *direntry,\n \t\tgoto out_err;\n \t}\n \n-\td_drop(direntry);\n \t*inode = newinode;\n \treturn rc;\n \n@@ -478,11 +478,11 @@ static int cifs_do_create(struct inode *dir, struct dentry *direntry,\n \t\t\t  unsigned int xid, struct tcon_link *tlink,\n \t\t\t  unsigned int oflags, umode_t mode,\n \t\t\t  __u32 *oplock, struct cifs_fid *fid,\n-\t\t\t  struct cifs_open_info_data *buf)\n+\t\t\t  struct cifs_open_info_data *buf,\n+\t\t\t  struct inode **inode)\n {\n \tvoid *page = alloc_dentry_path();\n \tconst char *full_path;\n-\tstruct inode *inode;\n \tint rc;\n \n \tfull_path = build_path_from_dentry(direntry, page);\n@@ -491,9 +491,7 @@ static int cifs_do_create(struct inode *dir, struct dentry *direntry,\n \t} else {\n \t\trc = __cifs_do_create(dir, direntry, full_path, xid,\n \t\t\t\t      tlink, oflags, mode, oplock,\n-\t\t\t\t      fid, buf, &inode);\n-\t\tif (!rc)\n-\t\t\td_add(direntry, inode);\n+\t\t\t\t      fid, buf, inode);\n \t}\n \tfree_dentry_path(page);\n \treturn rc;\n@@ -504,13 +502,13 @@ static int cifs_do_create(struct inode *dir, struct dentry *direntry,\n  * Look up, create and open a CIFS file.\n  *\n  * The initial dentry state is in-lookup or hashed-negative.  On success, dentry\n- * will become hashed-positive by calling d_drop() & d_add(), respectively.\n+ * will become hashed-positive by calling d_splice_alias() if in-lookup,\n+ * otherwise d_instantiate().\n  */\n-int\n-cifs_atomic_open(struct inode *inode, struct dentry *direntry,\n-\t\t struct file *file, unsigned int oflags, umode_t mode)\n+int cifs_atomic_open(struct inode *dir, struct dentry *direntry,\n+\t\t     struct file *file, unsigned int oflags, umode_t mode)\n {\n-\tstruct cifs_sb_info *cifs_sb = CIFS_SB(inode);\n+\tstruct cifs_sb_info *cifs_sb = CIFS_SB(dir);\n \tstruct cifs_open_info_data buf = {};\n \tstruct TCP_Server_Info *server;\n \tstruct cifsFileInfo *file_info;\n@@ -519,6 +517,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,\n \tstruct tcon_link *tlink;\n \tstruct cifs_tcon *tcon;\n \tunsigned int sbflags;\n+\tstruct dentry *alias;\n+\tstruct inode *inode;\n \tunsigned int xid;\n \t__u32 oplock;\n \tint rc;\n@@ -545,13 +545,13 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,\n \t\tif (!d_in_lookup(direntry))\n \t\t\treturn -ENOENT;\n \n-\t\treturn finish_no_open(file, cifs_lookup(inode, direntry, 0));\n+\t\treturn finish_no_open(file, cifs_lookup(dir, direntry, 0));\n \t}\n \n \txid = get_xid();\n \n \tcifs_dbg(FYI, \"parent inode = 0x%p name is: %pd and dentry = 0x%p\\n\",\n-\t\t inode, direntry, direntry);\n+\t\t dir, direntry, direntry);\n \n \ttlink = cifs_sb_tlink(cifs_sb);\n \tif (IS_ERR(tlink)) {\n@@ -572,13 +572,21 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,\n \n \tcifs_add_pending_open(&fid, tlink, &open);\n \n-\trc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,\n-\t\t\t    &oplock, &fid, &buf);\n+\trc = cifs_do_create(dir, direntry, xid, tlink, oflags, mode,\n+\t\t\t    &oplock, &fid, &buf, &inode);\n \tif (rc) {\n \t\tcifs_del_pending_open(&open);\n \t\tgoto out;\n \t}\n \n+\tif (d_in_lookup(direntry)) {\n+\t\talias = d_splice_alias(inode, direntry);\n+\t\tif (!IS_ERR_OR_NULL(alias))\n+\t\t\tdirentry = alias;\n+\t} else {\n+\t\td_instantiate(direntry, inode);\n+\t}\n+\n \tif ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))\n \t\tfile->f_mode |= FMODE_CREATED;\n \n@@ -622,11 +630,12 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,\n  * Create a CIFS file.\n  *\n  * The initial dentry state is hashed-negative.  On success, dentry will become\n- * hashed-positive by calling d_drop() & d_add(), respectively.\n+ * hashed-positive by calling d_instantiate().\n  */\n-int cifs_create(struct mnt_idmap *idmap, struct inode *inode,\n+int cifs_create(struct mnt_idmap *idmap, struct inode *dir,\n \t\tstruct dentry *direntry, umode_t mode, bool excl)\n {\n+\tstruct cifs_sb_info *cifs_sb = CIFS_SB(dir);\n \tint rc;\n \tunsigned int xid = get_xid();\n \t/*\n@@ -640,19 +649,20 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *inode,\n \tstruct tcon_link *tlink;\n \tstruct cifs_tcon *tcon;\n \tstruct TCP_Server_Info *server;\n+\tstruct inode *inode;\n \tstruct cifs_fid fid;\n \t__u32 oplock;\n \tstruct cifs_open_info_data buf = {};\n \n \tcifs_dbg(FYI, \"cifs_create parent inode = 0x%p name is: %pd and dentry = 0x%p\\n\",\n-\t\t inode, direntry, direntry);\n+\t\t dir, direntry, direntry);\n \n-\tif (unlikely(cifs_forced_shutdown(CIFS_SB(inode->i_sb)))) {\n+\tif (unlikely(cifs_forced_shutdown(cifs_sb))) {\n \t\trc = smb_EIO(smb_eio_trace_forced_shutdown);\n \t\tgoto out_free_xid;\n \t}\n \n-\ttlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));\n+\ttlink = cifs_sb_tlink(cifs_sb);\n \trc = PTR_ERR(tlink);\n \tif (IS_ERR(tlink))\n \t\tgoto out_free_xid;\n@@ -663,9 +673,13 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *inode,\n \tif (server->ops->new_lease_key)\n \t\tserver->ops->new_lease_key(&fid);\n \n-\trc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, &oplock, &fid, &buf);\n-\tif (!rc && server->ops->close)\n-\t\tserver->ops->close(xid, tcon, &fid);\n+\trc = cifs_do_create(dir, direntry, xid, tlink, oflags,\n+\t\t\t    mode, &oplock, &fid, &buf, &inode);\n+\tif (!rc) {\n+\t\td_instantiate(direntry, inode);\n+\t\tif (server->ops->close)\n+\t\t\tserver->ops->close(xid, tcon, &fid);\n+\t}\n \n \tcifs_free_open_info(&buf);\n \tcifs_put_tlink(tlink);\n@@ -1035,7 +1049,7 @@ static int set_tmpfile_attr(const unsigned int xid, unsigned int oflags,\n  * Create a hidden temporary CIFS file with delete-on-close bit set.\n  *\n  * The initial dentry state is unhashed-negative.  On success, dentry will\n- * become unhashed-positive by calling d_drop() & d_instantiate(), respectively.\n+ * become unhashed-positive by calling d_instantiate().\n  */\n int cifs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,\n \t\t struct file *file, umode_t mode)\n",
    "prefixes": []
}