cifs: add shutdown support
authorSteve French <stfrench@microsoft.com>
Thu, 29 Apr 2021 05:18:43 +0000 (00:18 -0500)
committerSteve French <stfrench@microsoft.com>
Mon, 3 May 2021 16:21:22 +0000 (11:21 -0500)
commit087f757b0129850c99cc9116df4909dac1bce871
treec284e0a56d512373e466b67aaed48a60403ae7c5
parentc3f207ab29f793b8c942ce8067ed123f18d5b81b
cifs: add shutdown support

Various filesystem support the shutdown ioctl which is used by various
xfstests. The shutdown ioctl sets a flag on the superblock which
prevents open, unlink, symlink, hardlink, rmdir, create etc.
on the file system until unmount and remounted. The two flags supported
in this patch are:

  FSOP_GOING_FLAGS_LOGFLUSH and FSOP_GOING_FLAGS_NOLOGFLUSH

which require very little other than blocking new operations (since
we do not cache writes to metadata on the client with cifs.ko).
FSOP_GOING_FLAGS_DEFAULT is not supported yet, but could be added in
the future but would need to call syncfs or equivalent to write out
pending data on the mount.

With this patch various xfstests now work including tests 043 through
046 for example.

Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
fs/cifs/cifs_fs_sb.h
fs/cifs/cifs_ioctl.h
fs/cifs/dir.c
fs/cifs/file.c
fs/cifs/fs_context.c
fs/cifs/inode.c
fs/cifs/ioctl.c
fs/cifs/link.c
fs/cifs/xattr.c