Skip to contentSkip to conversation

Support ioctl for directories

PATCH New Ronnie Sahlberg 1 participant 2 messages Oct 16, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Support ioctl for directories

Steve, all
This patch adds support for using the passthrough ioctl on directories. To do so, we always create a compound for open/query/close. Technically, in the case for files when we have a pSMBFile we could just do the query on the existing handle but that would complicate the code. If we need to avoid the extra open/close for the file case we could add those conditionals if we need to/they cause issues.

#1 lore raw

PATCH 1/1 cifs: add support for ioctl on directories

We do not call cifs_open_file() for directories and thus we do not have a pSMBFile we can extract the FIDs from.

Solve this by instead always using a compounded open/query/close for the passthrough ioctl.

---
 fs/cifs/cifsglob.h |  4 ++-
 fs/cifs/ioctl.c    | 43 +++++++++++++++++++++------
 fs/cifs/smb2ops.c  | 85 +++++++++++++++++++++++++++++++++++++++++-------------
 3 files changed, 102 insertions(+), 30 deletions(-)
fs/cifs/cifsglob.h +3 -1
index 73801254cc21..26f497bd97df 100644
@@ -33,6 +33,7 @@
 
 #define CIFS_MAGIC_NUMBER 0xFF534D42      /* the first four bytes of SMB PDUs */
 
+#define SMB_PATH_MAX 260
 #define CIFS_PORT 445
 #define RFC1001_PORT 139
 
@@ -467,7 +468,8 @@ struct smb_version_operations {
 	int (*next_header)(char *);
 	/* ioctl passthrough for query_info */
 	int (*ioctl_query_info)(const unsigned int xid,
-				struct cifsFileInfo *file,
+				struct cifs_tcon *tcon,
+				__le16 *path, int is_dir,
 				unsigned long p);
 };
 
fs/cifs/ioctl.c +34 -9

58 lines not on this page · raw message

fs/cifs/smb2ops.c +65 -20

126 lines not on this page · raw message

Signature · 1 line
2.13.6