All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aurélien Aptel" <aaptel@suse.com>
To: Steve French <smfrench@gmail.com>, CIFS <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: add shutdown support
Date: Thu, 29 Apr 2021 11:29:14 +0200	[thread overview]
Message-ID: <8735v9wiad.fsf@suse.com> (raw)
In-Reply-To: <CAH2r5mvKfohJ=NkkCM7AxqRYq2+D8kRMTxP3VdG=W0s72Cdh0A@mail.gmail.com>


Do we need to add code to clear the flag on remount or is it implicitely
cleared by not copying it?

Steve French <smfrench@gmail.com> writes:
>  #define CIFS_MOUNT_MODE_FROM_SID 0x10000000 /* retrieve mode from
> special ACE */
>  #define CIFS_MOUNT_RO_CACHE 0x20000000  /* assumes share will not change */
>  #define CIFS_MOUNT_RW_CACHE 0x40000000  /* assumes only client accessing */
> +#define SMB3_MOUNT_SHUTDOWN 0x80000000

While I totally understand wanting to remove the "cifs" name, those
flags are specific to the kernel & filesystem and have nothing to do
with the wire protocol so in this case I would rather use CIFS_ prefix
because SMB3_ is misleading and all the other flags are already using CIFS_.

One day we should do s/CIFS/SMBFS/i on the whole tree where CIFS refers
to kernel stuff (not protocol) and rename the module smbfs. But that's a
story for another day I guess.

>
>  struct cifs_sb_info {
>   struct rb_root tlink_tree;
> diff --git a/fs/cifs/cifs_ioctl.h b/fs/cifs/cifs_ioctl.h
> index 153d5c842a9b..a744022d2a71 100644
> --- a/fs/cifs/cifs_ioctl.h
> +++ b/fs/cifs/cifs_ioctl.h
> @@ -78,3 +78,19 @@ struct smb3_notify {
>  #define CIFS_QUERY_INFO _IOWR(CIFS_IOCTL_MAGIC, 7, struct smb_query_info)
>  #define CIFS_DUMP_KEY _IOWR(CIFS_IOCTL_MAGIC, 8, struct smb3_key_debug_info)
>  #define CIFS_IOC_NOTIFY _IOW(CIFS_IOCTL_MAGIC, 9, struct smb3_notify)
> +#define SMB3_IOC_SHUTDOWN _IOR ('X', 125, __u32)

Same

> +
> +/*
> + * Flags for going down operation
> + */
> +#define SMB3_GOING_FLAGS_DEFAULT                0x0     /* going down */
> +#define SMB3_GOING_FLAGS_LOGFLUSH               0x1     /* flush log
> but not data */
> +#define SMB3_GOING_FLAGS_NOLOGFLUSH             0x2     /* don't

Same

> flush log nor data */
> +
> +static inline bool smb3_forced_shutdown(struct cifs_sb_info *sbi)

Same

> +	cifs_dbg(VFS, "shut down requested (%d)", flags); /* BB FIXME */
> +/*	trace_smb3_shutdown(sb, flags);*/

What is there to fix? It's doing like ext4 so it's fine no?

> +
> +	/*
> +	 * see:
> +	 *   https://man7.org/linux/man-pages/man2/ioctl_xfs_goingdown.2.html
> +	 * for more information and description of original intent of the flags
> +	 */
> +	switch (flags) {
> +	/*
> +	 * We could add support later for default flag which requires:
> +	 *     "Flush all dirty data and metadata to disk"
> +	 * would need to call syncfs or equivalent to flush page cache for
> +	 * the mount and then issue fsync to server (if nostrictsync not set)
> +	 */
> +	case SMB3_GOING_FLAGS_DEFAULT:
> +		cifs_dbg(VFS, "default flags\n");

Should this be removed, less verbose or more info should be printed?

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)


  reply	other threads:[~2021-04-29  9:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  5:33 [PATCH] cifs: add shutdown support Steve French
2021-04-29  9:29 ` Aurélien Aptel [this message]
2021-04-29 18:39   ` Steve French
2021-04-30  0:07     ` Steve French
2021-04-30 16:41       ` Aurélien Aptel

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=8735v9wiad.fsf@suse.com \
    --to=aaptel@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.