Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Pavel Shilovsky <pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 09/45] CIFS: Add SMB2 support for unlink
Date: Wed, 12 Sep 2012 15:51:40 -0400	[thread overview]
Message-ID: <20120912155140.4efff904@corrin.poochiereds.net> (raw)
In-Reply-To: <1342626541-29872-10-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>

On Wed, 18 Jul 2012 19:48:25 +0400
Pavel Shilovsky <pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:

> Signed-off-by: Pavel Shilovsky <pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
> ---
>  fs/cifs/smb2inode.c |    9 +++++++++
>  fs/cifs/smb2ops.c   |    1 +
>  fs/cifs/smb2proto.h |    2 ++
>  3 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
> index 2aa5cb0..02a9bda 100644
> --- a/fs/cifs/smb2inode.c
> +++ b/fs/cifs/smb2inode.c
> @@ -161,3 +161,12 @@ smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
>  				  0, CREATE_NOT_FILE | CREATE_DELETE_ON_CLOSE,
>  				  NULL, SMB2_OP_DELETE);
>  }
> +
> +int
> +smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
> +	    struct cifs_sb_info *cifs_sb)
> +{
> +	return smb2_open_op_close(xid, tcon, cifs_sb, name, DELETE, FILE_OPEN,
> +				  0, CREATE_DELETE_ON_CLOSE, NULL,
> +				  SMB2_OP_DELETE);
> +}
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index 826209b..bf9b318 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -321,6 +321,7 @@ struct smb_version_operations smb21_operations = {
>  	.mkdir = smb2_mkdir,
>  	.mkdir_setinfo = smb2_mkdir_setinfo,
>  	.rmdir = smb2_rmdir,
> +	.unlink = smb2_unlink,
>  };
>  
>  struct smb_version_values smb21_values = {
> diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h
> index bfaa7b1..f4ac727 100644
> --- a/fs/cifs/smb2proto.h
> +++ b/fs/cifs/smb2proto.h
> @@ -59,6 +59,8 @@ extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path,
>  			       struct cifs_tcon *tcon, const unsigned int xid);
>  extern int smb2_rmdir(const unsigned int xid, struct cifs_tcon *tcon,
>  		      const char *name, struct cifs_sb_info *cifs_sb);
> +extern int smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon,
> +		       const char *name, struct cifs_sb_info *cifs_sb);
>  
>  /*
>   * SMB2 Worker functions - most of protocol specific implementation details

So, you're not defining a rename_pending_delete function here. That
means that if the initial unlink attempt happens to get back -ETXTBUSY,
you're now going to return -ENOSYS.

I think maybe it would be best to have cifs_unlink just fall through
and return -ETXTBUSY if there is no rename_pending_delete function.

-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

  parent reply	other threads:[~2012-09-12 19:51 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 15:48 [PATCH 00/45] SMB2 base operation support Pavel Shilovsky
     [not found] ` <1342626541-29872-1-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-07-18 15:48   ` [PATCH 01/45] CIFS: Make CAP_* checks protocol independent Pavel Shilovsky
     [not found]     ` <1342626541-29872-2-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-07-23 13:55       ` Jeff Layton
     [not found]         ` <CAKywueTxSBkBfp4wZW8Hy71F3dZ1gsthuHcLVO28--a4oEAMjw@mail.gmail.com>
     [not found]           ` <CAKywueTxSBkBfp4wZW8Hy71F3dZ1gsthuHcLVO28--a4oEAMjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-24  6:37             ` Pavel Shilovsky
2012-07-23 20:59       ` Jeff Layton
     [not found]         ` <20120723165947.5fad3d87-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-07-23 21:14           ` Steve French
2012-07-24  6:38           ` Pavel Shilovsky
2012-07-24  7:21       ` [PATCH v2 1/45] " Pavel Shilovsky
     [not found]         ` <1343114502-7908-1-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-07-24 17:44           ` Jeff Layton
2012-07-18 15:48   ` [PATCH 02/45] CIFS: Simpliify cifs_mkdir call Pavel Shilovsky
     [not found]     ` <1342626541-29872-3-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-08-01 19:39       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 03/45] CIFS: Separate protocol specific part from mkdir Pavel Shilovsky
     [not found]     ` <1342626541-29872-4-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-08-01 19:41       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 04/45] CIFS: Add SMB2 support for mkdir operation Pavel Shilovsky
     [not found]     ` <1342626541-29872-5-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-08-01 19:42       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 05/45] CIFS: Move rmdir code to ops struct Pavel Shilovsky
     [not found]     ` <1342626541-29872-6-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-08-01 19:45       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 06/45] CIFS: Add SMB2 support for rmdir Pavel Shilovsky
     [not found]     ` <1342626541-29872-7-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-08-01 19:47       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 07/45] CIFS: Protect i_nlink from being negative Pavel Shilovsky
     [not found]     ` <1342626541-29872-8-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-07-28 11:48       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 08/45] CIFS: Move unlink code to ops struct Pavel Shilovsky
     [not found]     ` <1342626541-29872-9-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-09-12 19:48       ` Jeff Layton
     [not found]         ` <20120912154804.19b97830-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-09-12 20:10           ` Jeff Layton
     [not found]             ` <20120912161038.4c32810a-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2012-09-13  6:04               ` Pavel Shilovsky
     [not found]                 ` <CAKywueTvDNzQQVG0TEvhu2CxEERQc9dxH-VuUwmgOf5d7eeniA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-13  6:12                   ` [PATCH v2 9/45] " Pavel Shilovsky
     [not found]                     ` <1347516738-6861-1-git-send-email-pshilovsky-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2012-09-13 12:07                       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 09/45] CIFS: Add SMB2 support for unlink Pavel Shilovsky
     [not found]     ` <1342626541-29872-10-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-09-12 19:51       ` Jeff Layton [this message]
2012-07-18 15:48   ` [PATCH 10/45] CIFS: Replace netfid with cifs_fid struct in cifsFileInfo Pavel Shilovsky
     [not found]     ` <1342626541-29872-11-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-09-12 19:55       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 11/45] CIFS: Move open code to ops struct Pavel Shilovsky
     [not found]     ` <1342626541-29872-12-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-09-12 20:12       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 12/45] CIFS: Move close " Pavel Shilovsky
     [not found]     ` <1342626541-29872-13-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-09-13 15:45       ` Jeff Layton
2012-07-18 15:48   ` [PATCH 13/45] CIFS: Add open/close file support for SMB2 Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 14/45] CIFS: Move guery file info code to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 15/45] CIFS: Add SMB2 support for query_file_info Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 16/45] CIFS: Move create code use ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 17/45] CIFS: Move reopen code to " Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 18/45] CIFS: Make flush code use " Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 19/45] CIFS: Add SMB2 support for flush Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 20/45] CIFS: Move r/wsize negotiating to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 21/45] CIFS: Add SMB2 r/wsize negotiating Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 22/45] CIFS: Move async read to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 23/45] CIFS: Add SMB2 support for cifs_iovec_read Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 24/45] CIFS: Move async write to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 25/45] CIFS: Add SMB2 support for cifs_iovec_write Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 26/45] CIFS: Move readpage code to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 27/45] CIFS: Add readpage support for SMB2 Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 28/45] CIFS: Move writepage to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 29/45] CIFS: Add writepage support for SMB2 Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 30/45] CIFS: Enable signing in SMB2 Pavel Shilovsky
     [not found]     ` <1342626541-29872-31-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2012-08-21  7:35       ` Stefan Metzmacher
2012-08-21 14:01         ` Pavel Shilovsky
2012-08-21 14:58         ` Shirish Pargaonkar
     [not found]           ` <CADT32e+4DSN=CSCbL+8GoRePknpD3X0HSq1hjVsXf3KHXQcmTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-22 13:46             ` Stefan (metze) Metzmacher
     [not found]               ` <5034E29E.7030006-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2013-07-08  6:15                 ` Shirish Pargaonkar
2012-07-18 15:48   ` [PATCH 31/45] CIFS: Move rename to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 32/45] CIFS: Add SMB2 support for rename operation Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 33/45] CIFS: Move hardlink to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 34/45] CIFS: Add SMB2 support for hardlink operation Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 35/45] CIFS: Move set_file_size to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 36/45] CIFS: Add SMB2 support for set_file_size Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 37/45] CIFS: Move set_file_info to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 38/45] CIFS: Add set_file_info support for SMB2 Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 39/45] CIFS: Move readdir code to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 40/45] CIFS: Add readdir support for SMB2 Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 41/45] CIFS: Process oplocks " Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 42/45] CIFS: Move oplock break to ops struct Pavel Shilovsky
2012-07-18 15:48   ` [PATCH 43/45] CIFS: Add oplock break support for SMB2 Pavel Shilovsky
2012-07-18 15:49   ` [PATCH 44/45] CIFS: Move statfs to ops struct Pavel Shilovsky
2012-07-18 15:49   ` [PATCH 45/45] CIFS: Add statfs support for SMB2 Pavel Shilovsky
2012-08-03 15:14   ` [PATCH 00/45] SMB2 base operation support Steve French

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=20120912155140.4efff904@corrin.poochiereds.net \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    /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