History

Merge tag 'fuse-update-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse updates from Miklos Szeredi: - Fix a regression introduced in 5.15 - Extend the size of the FUSE_INIT request to accommodate for more flags. There's a slight possibility of a regression for obscure fuse servers; if this happens, then more complexity will need to be added to the protocol - Allow the DAX property to be controlled by the server on a per-inode basis in virtiofs - Allow sending security context to the server when creating a file or directory * tag 'fuse-update-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: Documentation/filesystem/dax: DAX on virtiofs fuse: mark inode DONT_CACHE when per inode DAX hint changes fuse: negotiate per inode DAX in FUSE_INIT fuse: enable per inode DAX fuse: support per inode DAX in fuse protocol fuse: make DAX mount option a tri-state fuse: add fuse_should_enable_dax() helper fuse: Pass correct lend value to filemap_write_and_wait_range() fuse: send security context of inode on file fuse: extend init flags

Linus Torvalds committed 4 years ago

Commit 8975f892 parents 1fb38c9 073c3ab8 files · +294 −52Browse files

Showing the changes to include/uapi (1 of 8 files). Show all

Unified · Split

include/uapi/linux/fuse.h+51−4
@@ -187,6 +187,13 @@ · 186 unmodified lines
187187 *
188188 * 7.35
189189 * - add FOPEN_NOFLUSH
190+ *
191+ * 7.36
192+ * - extend fuse_init_in with reserved fields, add FUSE_INIT_EXT init flag
193+ * - add flags2 to fuse_init_in and fuse_init_out
194+ * - add FUSE_SECURITY_CTX init flag
195+ * - add security context to create, mkdir, symlink, and mknod requests
196+ * - add FUSE_HAS_INODE_DAX, FUSE_ATTR_DAX
190197 */
191198
192199 #ifndef _LINUX_FUSE_H
@@ -222,7 +229,7 @@ · 29 unmodified lines
222229 #define FUSE_KERNEL_VERSION 7
223230
224231 /** Minor version number of this interface */
225−#define FUSE_KERNEL_MINOR_VERSION 35
232+#define FUSE_KERNEL_MINOR_VERSION 36
226233
227234 /** The node ID of the root inode */
228235 #define FUSE_ROOT_ID 1
@@ -341,6 +348,11 @@ struct fuse_file_lock { · 112 unmodified lines
341348 * write/truncate sgid is killed only if file has group
342349 * execute permission. (Same as Linux VFS behavior).
343350 * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in
351+ * FUSE_INIT_EXT: extended fuse_init_in request
352+ * FUSE_INIT_RESERVED: reserved, do not use
353+ * FUSE_SECURITY_CTX: add security context to create, mkdir, symlink, and
354+ * mknod
355+ * FUSE_HAS_INODE_DAX: use per inode DAX
344356 */
345357 #define FUSE_ASYNC_READ (1 << 0)
346358 #define FUSE_POSIX_LOCKS (1 << 1)
@@ -372,6 +384,11 @@ struct fuse_file_lock { · 25 unmodified lines
372384 #define FUSE_SUBMOUNTS (1 << 27)
373385 #define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
374386 #define FUSE_SETXATTR_EXT (1 << 29)
387+#define FUSE_INIT_EXT (1 << 30)
388+#define FUSE_INIT_RESERVED (1 << 31)
389+/* bits 32..63 get shifted down 32 bits into the flags2 field */
390+#define FUSE_SECURITY_CTX (1ULL << 32)
391+#define FUSE_HAS_INODE_DAX (1ULL << 33)
375392
376393 /**
377394 * CUSE INIT request/reply flags
@@ -454,8 +471,10 @@ struct fuse_file_lock { · 76 unmodified lines
454471 * fuse_attr flags
455472 *
456473 * FUSE_ATTR_SUBMOUNT: Object is a submount root
474+ * FUSE_ATTR_DAX: Enable DAX for this file in per inode DAX mode
457475 */
458476 #define FUSE_ATTR_SUBMOUNT (1 << 0)
477+#define FUSE_ATTR_DAX (1 << 1)
459478
460479 /**
461480 * Open flags
@@ -741,6 +760,8 @@ struct fuse_init_in { · 279 unmodified lines
741760 uint32_t minor;
742761 uint32_t max_readahead;
743762 uint32_t flags;
763+ uint32_t flags2;
764+ uint32_t unused[11];
744765 };
745766
746767 #define FUSE_COMPAT_INIT_OUT_SIZE 8
@@ -757,7 +778,8 @@ struct fuse_init_out { · 10 unmodified lines
757778 uint32_t time_gran;
758779 uint16_t max_pages;
759780 uint16_t map_alignment;
760− uint32_t unused[8];
781+ uint32_t flags2;
782+ uint32_t unused[7];
761783 };
762784
763785 #define CUSE_INIT_INFO_MAX 4096
@@ -865,9 +887,12 @@ struct fuse_dirent { · 101 unmodified lines
865887 char name[];
866888 };
867889
868−#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
869−#define FUSE_DIRENT_ALIGN(x) \
890+/* Align variable length records to 64bit boundary */
891+#define FUSE_REC_ALIGN(x) \
870892 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
893+
894+#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
895+#define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x)
871896 #define FUSE_DIRENT_SIZE(d) \
872897 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
873898
@@ -984,4 +1009,26 @@ struct fuse_syncfs_in { · 110 unmodified lines
9841009 uint64_t padding;
9851010 };
9861011
1012+/*
1013+ * For each security context, send fuse_secctx with size of security context
1014+ * fuse_secctx will be followed by security context name and this in turn
1015+ * will be followed by actual context label.
1016+ * fuse_secctx, name, context
1017+ */
1018+struct fuse_secctx {
1019+ uint32_t size;
1020+ uint32_t padding;
1021+};
1022+
1023+/*
1024+ * Contains the information about how many fuse_secctx structures are being
1025+ * sent and what's the total size of all security contexts (including
1026+ * size of fuse_secctx_header).
1027+ *
1028+ */
1029+struct fuse_secctx_header {
1030+ uint32_t size;
1031+ uint32_t nr_secctx;
1032+};
1033+
9871034 #endif /* _LINUX_FUSE_H */