Do we need to add code to clear the flag on remount or is it implicitely cleared by not copying it? Steve French <smfrench@xxxxxxxxx> 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)