From: Steve French <smfrench@gmail.com>
To: "Aurélien Aptel" <aaptel@suse.com>
Cc: CIFS <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: add shutdown support
Date: Thu, 29 Apr 2021 13:39:12 -0500 [thread overview]
Message-ID: <CAH2r5msnQ4YjJee2FSKPRknNEWsD61V-hvw15m7L3_qBY+Nk1g@mail.gmail.com> (raw)
In-Reply-To: <8735v9wiad.fsf@suse.com>
You are correct - I have to add the code to clear the bit on remount
I have added your other changes and will send updated patch after lunch
root@smfrench-ThinkPad-P52:~# mount | grep cifs
//localhost/test on /mnt1 type cifs
(rw,relatime,vers=3.1.1,cache=strict,username=smfrench,uid=0,noforceuid,gid=0,noforcegid,addr=127.0.0.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,noperm,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
root@smfrench-ThinkPad-P52:~# touch /mnt1/file
root@smfrench-ThinkPad-P52:~# ~smfrench/xfstests-dev/src/godown /mnt1/
root@smfrench-ThinkPad-P52:~# touch /mnt1/file
touch: cannot touch '/mnt1/file': Input/output error
root@smfrench-ThinkPad-P52:~# mount -o remount /mnt1
root@smfrench-ThinkPad-P52:~# touch /mnt1/file
touch: cannot touch '/mnt1/file': Input/output error
On Thu, Apr 29, 2021 at 4:29 AM Aurélien Aptel <aaptel@suse.com> wrote:
>
>
> 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)
>
--
Thanks,
Steve
next prev parent reply other threads:[~2021-04-29 18:39 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
2021-04-29 18:39 ` Steve French [this message]
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=CAH2r5msnQ4YjJee2FSKPRknNEWsD61V-hvw15m7L3_qBY+Nk1g@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=aaptel@suse.com \
--cc=linux-cifs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).