@@ -1109,72 +1109,74 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
1109
1109
process_init_limits (fc , arg );
1110
1110
1111
1111
if (arg -> minor >= 6 ) {
1112
+ u64 flags = arg -> flags | (u64 ) arg -> flags2 << 32 ;
1113
+
1112
1114
ra_pages = arg -> max_readahead / PAGE_SIZE ;
1113
- if (arg -> flags & FUSE_ASYNC_READ )
1115
+ if (flags & FUSE_ASYNC_READ )
1114
1116
fc -> async_read = 1 ;
1115
- if (!(arg -> flags & FUSE_POSIX_LOCKS ))
1117
+ if (!(flags & FUSE_POSIX_LOCKS ))
1116
1118
fc -> no_lock = 1 ;
1117
1119
if (arg -> minor >= 17 ) {
1118
- if (!(arg -> flags & FUSE_FLOCK_LOCKS ))
1120
+ if (!(flags & FUSE_FLOCK_LOCKS ))
1119
1121
fc -> no_flock = 1 ;
1120
1122
} else {
1121
- if (!(arg -> flags & FUSE_POSIX_LOCKS ))
1123
+ if (!(flags & FUSE_POSIX_LOCKS ))
1122
1124
fc -> no_flock = 1 ;
1123
1125
}
1124
- if (arg -> flags & FUSE_ATOMIC_O_TRUNC )
1126
+ if (flags & FUSE_ATOMIC_O_TRUNC )
1125
1127
fc -> atomic_o_trunc = 1 ;
1126
1128
if (arg -> minor >= 9 ) {
1127
1129
/* LOOKUP has dependency on proto version */
1128
- if (arg -> flags & FUSE_EXPORT_SUPPORT )
1130
+ if (flags & FUSE_EXPORT_SUPPORT )
1129
1131
fc -> export_support = 1 ;
1130
1132
}
1131
- if (arg -> flags & FUSE_BIG_WRITES )
1133
+ if (flags & FUSE_BIG_WRITES )
1132
1134
fc -> big_writes = 1 ;
1133
- if (arg -> flags & FUSE_DONT_MASK )
1135
+ if (flags & FUSE_DONT_MASK )
1134
1136
fc -> dont_mask = 1 ;
1135
- if (arg -> flags & FUSE_AUTO_INVAL_DATA )
1137
+ if (flags & FUSE_AUTO_INVAL_DATA )
1136
1138
fc -> auto_inval_data = 1 ;
1137
- else if (arg -> flags & FUSE_EXPLICIT_INVAL_DATA )
1139
+ else if (flags & FUSE_EXPLICIT_INVAL_DATA )
1138
1140
fc -> explicit_inval_data = 1 ;
1139
- if (arg -> flags & FUSE_DO_READDIRPLUS ) {
1141
+ if (flags & FUSE_DO_READDIRPLUS ) {
1140
1142
fc -> do_readdirplus = 1 ;
1141
- if (arg -> flags & FUSE_READDIRPLUS_AUTO )
1143
+ if (flags & FUSE_READDIRPLUS_AUTO )
1142
1144
fc -> readdirplus_auto = 1 ;
1143
1145
}
1144
- if (arg -> flags & FUSE_ASYNC_DIO )
1146
+ if (flags & FUSE_ASYNC_DIO )
1145
1147
fc -> async_dio = 1 ;
1146
- if (arg -> flags & FUSE_WRITEBACK_CACHE )
1148
+ if (flags & FUSE_WRITEBACK_CACHE )
1147
1149
fc -> writeback_cache = 1 ;
1148
- if (arg -> flags & FUSE_PARALLEL_DIROPS )
1150
+ if (flags & FUSE_PARALLEL_DIROPS )
1149
1151
fc -> parallel_dirops = 1 ;
1150
- if (arg -> flags & FUSE_HANDLE_KILLPRIV )
1152
+ if (flags & FUSE_HANDLE_KILLPRIV )
1151
1153
fc -> handle_killpriv = 1 ;
1152
1154
if (arg -> time_gran && arg -> time_gran <= 1000000000 )
1153
1155
fm -> sb -> s_time_gran = arg -> time_gran ;
1154
- if ((arg -> flags & FUSE_POSIX_ACL )) {
1156
+ if ((flags & FUSE_POSIX_ACL )) {
1155
1157
fc -> default_permissions = 1 ;
1156
1158
fc -> posix_acl = 1 ;
1157
1159
fm -> sb -> s_xattr = fuse_acl_xattr_handlers ;
1158
1160
}
1159
- if (arg -> flags & FUSE_CACHE_SYMLINKS )
1161
+ if (flags & FUSE_CACHE_SYMLINKS )
1160
1162
fc -> cache_symlinks = 1 ;
1161
- if (arg -> flags & FUSE_ABORT_ERROR )
1163
+ if (flags & FUSE_ABORT_ERROR )
1162
1164
fc -> abort_err = 1 ;
1163
- if (arg -> flags & FUSE_MAX_PAGES ) {
1165
+ if (flags & FUSE_MAX_PAGES ) {
1164
1166
fc -> max_pages =
1165
1167
min_t (unsigned int , fc -> max_pages_limit ,
1166
1168
max_t (unsigned int , arg -> max_pages , 1 ));
1167
1169
}
1168
1170
if (IS_ENABLED (CONFIG_FUSE_DAX ) &&
1169
- arg -> flags & FUSE_MAP_ALIGNMENT &&
1171
+ flags & FUSE_MAP_ALIGNMENT &&
1170
1172
!fuse_dax_check_alignment (fc , arg -> map_alignment )) {
1171
1173
ok = false;
1172
1174
}
1173
- if (arg -> flags & FUSE_HANDLE_KILLPRIV_V2 ) {
1175
+ if (flags & FUSE_HANDLE_KILLPRIV_V2 ) {
1174
1176
fc -> handle_killpriv_v2 = 1 ;
1175
1177
fm -> sb -> s_flags |= SB_NOSEC ;
1176
1178
}
1177
- if (arg -> flags & FUSE_SETXATTR_EXT )
1179
+ if (flags & FUSE_SETXATTR_EXT )
1178
1180
fc -> setxattr_ext = 1 ;
1179
1181
} else {
1180
1182
ra_pages = fc -> max_read / PAGE_SIZE ;
@@ -1203,13 +1205,14 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
1203
1205
void fuse_send_init (struct fuse_mount * fm )
1204
1206
{
1205
1207
struct fuse_init_args * ia ;
1208
+ u64 flags ;
1206
1209
1207
1210
ia = kzalloc (sizeof (* ia ), GFP_KERNEL | __GFP_NOFAIL );
1208
1211
1209
1212
ia -> in .major = FUSE_KERNEL_VERSION ;
1210
1213
ia -> in .minor = FUSE_KERNEL_MINOR_VERSION ;
1211
1214
ia -> in .max_readahead = fm -> sb -> s_bdi -> ra_pages * PAGE_SIZE ;
1212
- ia -> in . flags | =
1215
+ flags =
1213
1216
FUSE_ASYNC_READ | FUSE_POSIX_LOCKS | FUSE_ATOMIC_O_TRUNC |
1214
1217
FUSE_EXPORT_SUPPORT | FUSE_BIG_WRITES | FUSE_DONT_MASK |
1215
1218
FUSE_SPLICE_WRITE | FUSE_SPLICE_MOVE | FUSE_SPLICE_READ |
@@ -1219,13 +1222,16 @@ void fuse_send_init(struct fuse_mount *fm)
1219
1222
FUSE_PARALLEL_DIROPS | FUSE_HANDLE_KILLPRIV | FUSE_POSIX_ACL |
1220
1223
FUSE_ABORT_ERROR | FUSE_MAX_PAGES | FUSE_CACHE_SYMLINKS |
1221
1224
FUSE_NO_OPENDIR_SUPPORT | FUSE_EXPLICIT_INVAL_DATA |
1222
- FUSE_HANDLE_KILLPRIV_V2 | FUSE_SETXATTR_EXT ;
1225
+ FUSE_HANDLE_KILLPRIV_V2 | FUSE_SETXATTR_EXT | FUSE_INIT_EXT ;
1223
1226
#ifdef CONFIG_FUSE_DAX
1224
1227
if (fm -> fc -> dax )
1225
- ia -> in . flags |= FUSE_MAP_ALIGNMENT ;
1228
+ flags |= FUSE_MAP_ALIGNMENT ;
1226
1229
#endif
1227
1230
if (fm -> fc -> auto_submounts )
1228
- ia -> in .flags |= FUSE_SUBMOUNTS ;
1231
+ flags |= FUSE_SUBMOUNTS ;
1232
+
1233
+ ia -> in .flags = flags ;
1234
+ ia -> in .flags2 = flags >> 32 ;
1229
1235
1230
1236
ia -> args .opcode = FUSE_INIT ;
1231
1237
ia -> args .in_numargs = 1 ;
0 commit comments