Re: [PATCH] cifs: add shutdown support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx> 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@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)
>


-- 
Thanks,

Steve




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux