Skip to content

Commit

Permalink
Merge tag '5.15-rc-cifs-part2' of git://git.samba.org/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
Pull smbfs updates from Steve French:
 "cifs/smb3 updates:

   - DFS reconnect fix

   - begin creating common headers for server and client

   - rename the cifs_common directory to smbfs_common to be more
     consistent ie change use of the name cifs to smb (smb3 or smbfs is
     more accurate, as the very old cifs dialect has long been
     superseded by smb3 dialects).

  In the future we can rename the fs/cifs directory to fs/smbfs.

  This does not include the set of multichannel fixes nor the two
  deferred close fixes (they are still being reviewed and tested)"

* tag '5.15-rc-cifs-part2' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: properly invalidate cached root handle when closing it
  cifs: move SMB FSCTL definitions to common code
  cifs: rename cifs_common to smbfs_common
  cifs: update FSCTL definitions
  • Loading branch information
torvalds committed Sep 12, 2021
2 parents 78e7095 + 9351590 commit 8d4a0b5
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 21 deletions.
2 changes: 1 addition & 1 deletion fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ source "fs/ceph/Kconfig"
source "fs/cifs/Kconfig"
source "fs/ksmbd/Kconfig"

config CIFS_COMMON
config SMBFS_COMMON
tristate
default y if CIFS=y
default m if CIFS=m
Expand Down
2 changes: 1 addition & 1 deletion fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ obj-$(CONFIG_LOCKD) += lockd/
obj-$(CONFIG_NLS) += nls/
obj-$(CONFIG_UNICODE) += unicode/
obj-$(CONFIG_SYSV_FS) += sysv/
obj-$(CONFIG_CIFS_COMMON) += cifs_common/
obj-$(CONFIG_SMBFS_COMMON) += smbfs_common/
obj-$(CONFIG_CIFS) += cifs/
obj-$(CONFIG_SMB_SERVER) += ksmbd/
obj-$(CONFIG_HPFS_FS) += hpfs/
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifsencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <linux/random.h>
#include <linux/highmem.h>
#include <linux/fips.h>
#include "../cifs_common/arc4.h"
#include "../smbfs_common/arc4.h"
#include <crypto/aead.h>

int __cifs_calc_signature(struct smb_rqst *rqst,
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifspdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <net/sock.h>
#include <asm/unaligned.h>
#include "smbfsctl.h"
#include "../smbfs_common/smbfsctl.h"

#define CIFS_PROT 0
#define POSIX_PROT (CIFS_PROT+1)
Expand Down
20 changes: 13 additions & 7 deletions fs/cifs/smb2ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,19 @@ smb2_close_cached_fid(struct kref *ref)
cifs_dbg(FYI, "clear cached root file handle\n");
SMB2_close(0, cfid->tcon, cfid->fid->persistent_fid,
cfid->fid->volatile_fid);
cfid->is_valid = false;
cfid->file_all_info_is_valid = false;
cfid->has_lease = false;
if (cfid->dentry) {
dput(cfid->dentry);
cfid->dentry = NULL;
}
}

/*
* We only check validity above to send SMB2_close,
* but we still need to invalidate these entries
* when this function is called
*/
cfid->is_valid = false;
cfid->file_all_info_is_valid = false;
cfid->has_lease = false;
if (cfid->dentry) {
dput(cfid->dentry);
cfid->dentry = NULL;
}
}

Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/smbencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "cifsglob.h"
#include "cifs_debug.h"
#include "cifsproto.h"
#include "../cifs_common/md4.h"
#include "../smbfs_common/md4.h"

#ifndef false
#define false 0
Expand Down
4 changes: 2 additions & 2 deletions fs/cifs_common/Makefile → fs/smbfs_common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Makefile for Linux filesystem routines that are shared by client and server.
#

obj-$(CONFIG_CIFS_COMMON) += cifs_arc4.o
obj-$(CONFIG_CIFS_COMMON) += cifs_md4.o
obj-$(CONFIG_SMBFS_COMMON) += cifs_arc4.o
obj-$(CONFIG_SMBFS_COMMON) += cifs_md4.o
File renamed without changes.
8 changes: 4 additions & 4 deletions fs/cifs_common/cifs_arc4.c → fs/smbfs_common/cifs_arc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ void cifs_arc4_crypt(struct arc4_ctx *ctx, u8 *out, const u8 *in, unsigned int l
EXPORT_SYMBOL_GPL(cifs_arc4_crypt);

static int __init
init_cifs_common(void)
init_smbfs_common(void)
{
return 0;
}
static void __init
exit_cifs_common(void)
exit_smbfs_common(void)
{
}

module_init(init_cifs_common)
module_exit(exit_cifs_common)
module_init(init_smbfs_common)
module_exit(exit_smbfs_common)
File renamed without changes.
File renamed without changes.
16 changes: 13 additions & 3 deletions fs/cifs/smbfsctl.h → fs/smbfs_common/smbfsctl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1 */
/* SPDX-License-Identifier: LGPL-2.1+ */
/*
* fs/cifs/smbfsctl.h: SMB, CIFS, SMB2 FSCTL definitions
*
Expand All @@ -19,11 +19,14 @@
* could be invoked from tools via a specialized hook into the VFS rather
* than via the standard vfs entry points
*
* See MS-SMB2 Section 2.2.31 (last checked June 2013, all of that list are
* See MS-SMB2 Section 2.2.31 (last checked September 2021, all of that list are
* below). Additional detail on less common ones can be found in MS-FSCC
* section 2.3.
*/

#ifndef __SMBFSCTL_H
#define __SMBFSCTL_H

/*
* FSCTL values are 32 bits and are constructed as
* <device 16bits> <access 2bits> <function 12bits> <method 2bits>
Expand Down Expand Up @@ -91,6 +94,7 @@
#define FSCTL_SET_ZERO_ON_DEALLOC 0x00090194 /* BB add struct */
#define FSCTL_SET_SHORT_NAME_BEHAVIOR 0x000901B4 /* BB add struct */
#define FSCTL_GET_INTEGRITY_INFORMATION 0x0009027C
#define FSCTL_GET_REFS_VOLUME_DATA 0x000902D8 /* See MS-FSCC 2.3.24 */
#define FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT 0x000903d3
#define FSCTL_GET_RETRIEVAL_POINTER_COUNT 0x0009042b
#define FSCTL_QUERY_ALLOCATED_RANGES 0x000940CF
Expand Down Expand Up @@ -146,7 +150,13 @@
#define IO_REPARSE_TAG_LX_CHR 0x80000025
#define IO_REPARSE_TAG_LX_BLK 0x80000026

#define IO_REPARSE_TAG_LX_SYMLINK_LE cpu_to_le32(0xA000001D)
#define IO_REPARSE_TAG_AF_UNIX_LE cpu_to_le32(0x80000023)
#define IO_REPARSE_TAG_LX_FIFO_LE cpu_to_le32(0x80000024)
#define IO_REPARSE_TAG_LX_CHR_LE cpu_to_le32(0x80000025)
#define IO_REPARSE_TAG_LX_BLK_LE cpu_to_le32(0x80000026)

/* fsctl flags */
/* If Flags is set to this value, the request is an FSCTL not ioctl request */
#define SMB2_0_IOCTL_IS_FSCTL 0x00000001

#endif /* __SMBFSCTL_H */

0 comments on commit 8d4a0b5

Please sign in to comment.