Commit 58a6527c authored by Bernd Lietzow's avatar Bernd Lietzow 🐨

update to release 7.1.5

parent f009209a
...@@ -21,7 +21,11 @@ else ...@@ -21,7 +21,11 @@ else
BEEGFS_EPOCH := 20 BEEGFS_EPOCH := 20
endif endif
BEEGFS_VERSION_DEB := $(BEEGFS_EPOCH):${BEEGFS_VERSION} # sanitize version strings:
# rpm accepts underscores but not dashes
# deb accepts dashes but not underscores
BEEGFS_VERSION_RPM := $(subst -,_,$(BEEGFS_VERSION))
BEEGFS_VERSION_DEB := $(BEEGFS_EPOCH):$(subst _,-,$(BEEGFS_VERSION))
export BEEGFS_VERSION export BEEGFS_VERSION
PREFIX ?= /opt/beegfs PREFIX ?= /opt/beegfs
...@@ -169,10 +173,10 @@ package-rpm: clean ...@@ -169,10 +173,10 @@ package-rpm: clean
! [ -d '$(PACKAGE_DIR)' ] || { echo choose a new directory for PACKAGE_DIR, please >&2; false; } ! [ -d '$(PACKAGE_DIR)' ] || { echo choose a new directory for PACKAGE_DIR, please >&2; false; }
mkdir -p $(PACKAGE_DIR)/SOURCES mkdir -p $(PACKAGE_DIR)/SOURCES
tar --exclude $(PACKAGE_DIR) --exclude .git --exclude .ccache \ tar --exclude $(PACKAGE_DIR) --exclude .git --exclude .ccache \
-cf $(PACKAGE_DIR)/SOURCES/beegfs-$(BEEGFS_VERSION).tar . -cf $(PACKAGE_DIR)/SOURCES/beegfs-$(BEEGFS_VERSION_RPM).tar .
rpmbuild --clean -bb beegfs.spec \ rpmbuild --clean -bb beegfs.spec \
--define '_topdir $(abspath $(PACKAGE_DIR))' \ --define '_topdir $(abspath $(PACKAGE_DIR))' \
--define 'EPOCH $(BEEGFS_EPOCH)' \ --define 'EPOCH $(BEEGFS_EPOCH)' \
--define 'BEEGFS_VERSION $(BEEGFS_VERSION)' \ --define 'BEEGFS_VERSION $(BEEGFS_VERSION_RPM)' \
$(RPMBUILD_OPTS) $(RPMBUILD_OPTS)
...@@ -361,6 +361,8 @@ make -C client_module/build %make_j \ ...@@ -361,6 +361,8 @@ make -C client_module/build %make_j \
RELEASE_PATH=${RPM_BUILD_ROOT}/opt/beegfs/src/client KDIR="%{KDIR}" V=1 \ RELEASE_PATH=${RPM_BUILD_ROOT}/opt/beegfs/src/client KDIR="%{KDIR}" V=1 \
prepare_release prepare_release
cp client_module/build/dist/etc/*.conf ${RPM_BUILD_ROOT}/etc/beegfs/ cp client_module/build/dist/etc/*.conf ${RPM_BUILD_ROOT}/etc/beegfs/
cp client_module/build/dist/etc/beegfs-client-build.mk ${RPM_BUILD_ROOT}/etc/beegfs/beegfs-client-build.mk
# compat files # compat files
cp -a ${RPM_BUILD_ROOT}/%{CLIENT_DIR} ${RPM_BUILD_ROOT}/%{CLIENT_COMPAT_DIR} cp -a ${RPM_BUILD_ROOT}/%{CLIENT_DIR} ${RPM_BUILD_ROOT}/%{CLIENT_COMPAT_DIR}
...@@ -391,9 +393,18 @@ install -D client_module/build/dist/etc/beegfs-client-mount-hook.example \ ...@@ -391,9 +393,18 @@ install -D client_module/build/dist/etc/beegfs-client-mount-hook.example \
########## ##########
cp client_module/build/dist/etc/*.conf ${RPM_BUILD_ROOT}/etc/beegfs/ cp client_module/build/dist/etc/*.conf ${RPM_BUILD_ROOT}/etc/beegfs/
mkdir -p ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER} mkdir -p ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER}
cp -r client_module/build ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER} cp -r client_module/build ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER}
cp -r client_module/source ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER} cp -r client_module/source ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER}
rm -Rf ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER}/build/dist
install -D client_module/build/dist/sbin/beegfs-setup-client \
${RPM_BUILD_ROOT}/opt/beegfs/sbin/beegfs-setup-client
sed -e 's/__VERSION__/%{VER}/g' -e 's/__NAME__/beegfs/g' -e 's/__MODNAME__/beegfs/g' \ sed -e 's/__VERSION__/%{VER}/g' -e 's/__NAME__/beegfs/g' -e 's/__MODNAME__/beegfs/g' \
< client_module/dkms.conf.in \ < client_module/dkms.conf.in \
> ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER}/dkms.conf > ${RPM_BUILD_ROOT}/usr/src/beegfs-%{VER}/dkms.conf
...@@ -765,6 +776,7 @@ touch /var/lib/beegfs/client/force-auto-build ...@@ -765,6 +776,7 @@ touch /var/lib/beegfs/client/force-auto-build
%config(noreplace) /etc/beegfs/beegfs-client-autobuild.conf %config(noreplace) /etc/beegfs/beegfs-client-autobuild.conf
%config(noreplace) /etc/beegfs/beegfs-client-mount-hook.example %config(noreplace) /etc/beegfs/beegfs-client-mount-hook.example
%config(noreplace) /etc/beegfs/beegfs-client.conf %config(noreplace) /etc/beegfs/beegfs-client.conf
%config(noreplace) /etc/beegfs/beegfs-client-build.mk
%config(noreplace) /etc/beegfs/beegfs-mounts.conf %config(noreplace) /etc/beegfs/beegfs-mounts.conf
%dir /etc/beegfs/lib/ %dir /etc/beegfs/lib/
%config(noreplace) /etc/beegfs/lib/init-multi-mode.beegfs-client %config(noreplace) /etc/beegfs/lib/init-multi-mode.beegfs-client
......
...@@ -256,13 +256,12 @@ check_pdsh() ...@@ -256,13 +256,12 @@ check_pdsh()
# execute cmd # execute cmd
test -e "${PDSH}" &&\ test -e "${PDSH}" &&\
${PDSH} -R ${PDSH_RCMD} -S -w "${HOSTS}" \ ${PDSH} -R ${PDSH_RCMD} -S -w "${HOSTS}" \
"if [ -e ${BEEOND_STOPLOCAL} ]; then true; else return 2; fi" "test \${SHELL} = '/bin/bash' || exit 2"
RES=$? RES=$?
if [ $RES -eq 2 ] if [ $RES -eq 2 ]
then then
print_error_and_exit "Unable to find BeeOND helper program on one or more nodes. print_error_and_exit "One or more hosts don't use /bin/bash as default shell."
Please make sure BeeOND is installed on all machines."
elif [ $RES -ne 0 ] elif [ $RES -ne 0 ]
then then
print_info "pdsh does not seem to work on all nodes. Disabling pdsh and using ssh instead" print_info "pdsh does not seem to work on all nodes. Disabling pdsh and using ssh instead"
...@@ -275,7 +274,13 @@ Please make sure BeeOND is installed on all machines." ...@@ -275,7 +274,13 @@ Please make sure BeeOND is installed on all machines."
check_reachability "${HOST}" check_reachability "${HOST}"
done done
unset IFS unset IFS
return
fi fi
${PDSH} -R ${PDSH_RCMD} -S -w "${HOSTS}" \
"if [ -e ${BEEOND_STOPLOCAL} ]; then true; else exit 2; fi" || \
print_error_and_exit "Unable to find BeeOND helper program on one or more nodes.
Please make sure BeeOND is installed on all machines."
} }
execute_ssh_cmd() execute_ssh_cmd()
...@@ -341,19 +346,22 @@ check_reachability() ...@@ -341,19 +346,22 @@ check_reachability()
print_info "Checking reachability of host ${HOST}" print_info "Checking reachability of host ${HOST}"
execute_ssh_cmd "${HOST}" "test -e ${BEEOND_STOPLOCAL}" execute_ssh_cmd "${HOST}" "test \${SHELL} = '/bin/bash'"
RES=$? RES=$?
if [ $RES -eq 255 ] if [ $RES -eq 255 ]
then then
print_error_and_exit "Host is unreachable via ssh: ${HOST}" print_error_and_exit "Host is unreachable via ssh: ${HOST}"
elif [ $RES -eq 1 ] elif [ $RES -eq 1 ]
then then
print_error_and_exit "Could not find BeeOND helper program on host: ${HOST} print_error_and_exit "Host doesn't use /bin/bash as default shell: ${HOST}"
Please make sure BeeOND is installed on all machines."
elif [ $RES -ne 0 ] elif [ $RES -ne 0 ]
then then
print_error_and_exit "Error contacting host: ${HOST}" print_error_and_exit "Error contacting host: ${HOST}"
fi fi
execute_ssh_cmd "${HOST}" "test -e ${BEEOND_STOPLOCAL}" || \
print_error_and_exit "Could not find BeeOND helper program on host: ${HOST}
Please make sure BeeOND is installed on all machines."
} }
check_hostfile() check_hostfile()
...@@ -571,13 +579,9 @@ ${BEEGFS_BIN_PATH}/${META_BIN} \${PARAMS}" ...@@ -571,13 +579,9 @@ ${BEEGFS_BIN_PATH}/${META_BIN} \${PARAMS}"
ln -s ${DATAPATH}/${META_NUMID_FILE} ${PREFERRED_MDS_FILE}" "false" ln -s ${DATAPATH}/${META_NUMID_FILE} ${PREFERRED_MDS_FILE}" "false"
fi fi
IFS=','
for HOST in ${HOSTS} execute_pdsh_cmd "${HOSTS}" "echo %h,${META_BIN},${DATAPATH},${LOGFILE},${PIDFILE} >> ${STATUSFILE}" "false"
do
if [ "${HOST}" = "" ]; then continue; fi
add_to_status_file "${HOST}" "${META_BIN}" "${DATAPATH}" "${LOGFILE}" "${PIDFILE}"
done
unset IFS
else else
# no pdsh => do it manually with ssh loop # no pdsh => do it manually with ssh loop
print_info "Starting ${META_BIN} processes" print_info "Starting ${META_BIN} processes"
...@@ -679,13 +683,8 @@ needed parameters" ...@@ -679,13 +683,8 @@ needed parameters"
ln -s ${DATAPATH}/${TARGET_NUMID_FILE} ${PREFERRED_TARGET_FILE}" "false" ln -s ${DATAPATH}/${TARGET_NUMID_FILE} ${PREFERRED_TARGET_FILE}" "false"
fi fi
IFS=',' execute_pdsh_cmd "${HOSTS}" "echo %h,${STORAGE_BIN},${DATAPATH},${LOGFILE},${PIDFILE} >> ${STATUSFILE}" "false"
for HOST in ${HOSTS}
do
if [ "${HOST}" = "" ]; then continue; fi
add_to_status_file "${HOST}" "${STORAGE_BIN}" "${DATAPATH}" "${LOGFILE}" "${PIDFILE}"
done
unset IFS
else else
# no pdsh => do it manually with ssh loop # no pdsh => do it manually with ssh loop
print_info "Starting ${STORAGE_BIN} processes" print_info "Starting ${STORAGE_BIN} processes"
...@@ -941,16 +940,8 @@ mkdir -p ${MOUNTPOINT} && ${MODPROBE_CMD} && mount -t beegfs beegfs_ondemand ${M ...@@ -941,16 +940,8 @@ mkdir -p ${MOUNTPOINT} && ${MODPROBE_CMD} && mount -t beegfs beegfs_ondemand ${M
execute_pdsh_cmd "${HOSTS}" "${HELPERD_CMD}" "false" execute_pdsh_cmd "${HOSTS}" "${HELPERD_CMD}" "false"
IFS=',' execute_pdsh_cmd "${HOSTS}" "echo %h,${HELPERD_BIN},-,${LOGFILE},${PIDFILE} >> ${STATUSFILE}" "false"
for HOST in ${HOSTS} execute_pdsh_cmd "${HOSTS}" "echo %h,${CLIENT_BIN},${MOUNTPOINT},${LOGFILE},- >> ${STATUSFILE}" "false"
do
if [ "${HOST}" = "" ]; then continue; fi
# NOTE : - is empty data path
add_to_status_file "${HOST}" "${HELPERD_BIN}" - "${LOGFILE}" "${PIDFILE}"
# NOTE : mountpoint as data path
add_to_status_file "${HOST}" "${CLIENT_BIN}" "${MOUNTPOINT}" "${LOGFILE}" -
done
unset IFS
execute_pdsh_cmd "${HOSTS}" "${MODPROBE_CMD} || ${REBUILD_CMD}" "false" execute_pdsh_cmd "${HOSTS}" "${MODPROBE_CMD} || ${REBUILD_CMD}" "false"
execute_pdsh_cmd "${HOSTS}" "${MOUNT_CMD}" "false" execute_pdsh_cmd "${HOSTS}" "${MOUNT_CMD}" "false"
...@@ -997,7 +988,7 @@ from source." ...@@ -997,7 +988,7 @@ from source."
if [ "${PREFER_LOCAL}" = "true" ] #set target count to 1 if [ "${PREFER_LOCAL}" = "true" ] #set target count to 1
then then
CTL_CMD="${CTL_BIN} --sysMgmtdHost=${MGMTD} --connPortShift=${PORT_SHIFT} \ CTL_CMD="${CTL_BIN} --sysMgmtdHost=${MGMTD} --connPortShift=${PORT_SHIFT} \
--setpattern --numtargets=1 --chunksize=512k ${MOUNTPOINT} > /dev/null" --setpattern --numtargets=1 --chunksize=512k ${MOUNTPOINT} > /dev/null"
execute_ssh_cmd "${HOST}" "${CTL_CMD}" execute_ssh_cmd "${HOST}" "${CTL_CMD}"
fi fi
......
...@@ -288,6 +288,9 @@ $(call define_if_matches, KERNEL_HAS_WQ_RESCUER, "WQ_RESCUER", workqueue.h) ...@@ -288,6 +288,9 @@ $(call define_if_matches, KERNEL_HAS_WQ_RESCUER, "WQ_RESCUER", workqueue.h)
$(call define_if_matches, KERNEL_HAS_WAIT_QUEUE_ENTRY_T, "wait_queue_entry_t", wait.h) $(call define_if_matches, KERNEL_HAS_WAIT_QUEUE_ENTRY_T, "wait_queue_entry_t", wait.h)
$(call define_if_matches, KERNEL_HAS_CURRENT_FS_TIME, "current_fs_time", fs.h) $(call define_if_matches, KERNEL_HAS_CURRENT_FS_TIME, "current_fs_time", fs.h)
$(call define_if_matches, KERNEL_HAS_64BIT_TIMESTAMPS, "struct timespec64[[:space:]]\+i_atime;", fs.h) $(call define_if_matches, KERNEL_HAS_64BIT_TIMESTAMPS, "struct timespec64[[:space:]]\+i_atime;", fs.h)
$(call define_if_matches, KERNEL_HAS_KTIME_GET, "ktime_get_real_ts64", timekeeping.h)
$(call define_if_matches, KERNEL_HAS_SB_NODIRATIME, "SB_NODIRATIME", fs.h)
$(call define_if_matches, KERNEL_IB_DESTROY_CQ_IS_VOID, "static inline void ib_destroy_cq", ../rdma/ib_verbs.h)
# inodeChangeRes was changed to setattr_prepare in vanilla 4.9 # inodeChangeRes was changed to setattr_prepare in vanilla 4.9
$(call define_if_matches, KERNEL_HAS_SETATTR_PREPARE, "int setattr_prepare", fs.h) $(call define_if_matches, KERNEL_HAS_SETATTR_PREPARE, "int setattr_prepare", fs.h)
...@@ -298,3 +301,6 @@ KERNEL_FEATURE_DETECTION += $(shell \ ...@@ -298,3 +301,6 @@ KERNEL_FEATURE_DETECTION += $(shell \
grep -sA1 "(*rename) " $(KSRCDIR_PRUNED_HEAD)/include/linux/fs.h \ grep -sA1 "(*rename) " $(KSRCDIR_PRUNED_HEAD)/include/linux/fs.h \
| grep -qsF "unsigned int" \ | grep -qsF "unsigned int" \
&& echo "-DKERNEL_HAS_RENAME_FLAGS") && echo "-DKERNEL_HAS_RENAME_FLAGS")
$(call define_if_matches, KERNEL_ACCESS_OK_WANTS_TYPE, "define access_ok(type, addr, size)" \
$(KSRCDIR_PRUNED_HEAD)/include/asm-generic/uaccess.h)
...@@ -150,7 +150,7 @@ ifneq ($(OFED_INCLUDE_PATH),) ...@@ -150,7 +150,7 @@ ifneq ($(OFED_INCLUDE_PATH),)
fi fi
endif endif
$(MAKE) -C $(KDIR_PRUNED_HEAD) "SUBDIRS=$(BEEGFS_BUILDDIR)/../source" \ $(MAKE) -C $(KDIR_PRUNED_HEAD) "M=$(BEEGFS_BUILDDIR)/../source" \
"EXTRA_CFLAGS=$(BEEGFS_CFLAGS) $(EXTRA_CFLAGS)" modules "EXTRA_CFLAGS=$(BEEGFS_CFLAGS) $(EXTRA_CFLAGS)" modules
@cp ../source/$(TARGET).ko . @cp ../source/$(TARGET).ko .
...@@ -158,7 +158,7 @@ endif ...@@ -158,7 +158,7 @@ endif
@ ${STRIP} --strip-debug ${TARGET}.ko; @ ${STRIP} --strip-debug ${TARGET}.ko;
coccicheck: coccicheck:
$(MAKE) -C $(KDIR_PRUNED_HEAD) "SUBDIRS=$(BEEGFS_BUILDDIR)" coccicheck MODE=report \ $(MAKE) -C $(KDIR_PRUNED_HEAD) "M=$(BEEGFS_BUILDDIR)" coccicheck MODE=report \
M=$(BEEGFS_BUILDDIR)/../source KBUILD_EXTMOD="$(BEEGFS_BUILDDIR)/../source" M=$(BEEGFS_BUILDDIR)/../source KBUILD_EXTMOD="$(BEEGFS_BUILDDIR)/../source"
......
...@@ -134,7 +134,7 @@ ifneq ($(OFED_INCLUDE_PATH),) ...@@ -134,7 +134,7 @@ ifneq ($(OFED_INCLUDE_PATH),)
endif endif
@echo "Building beegfs client module" @echo "Building beegfs client module"
$(MAKE) -C $(KDIR_PRUNED_HEAD) SUBDIRS=$(BEEGFS_BUILDDIR)/../source \ $(MAKE) -C $(KDIR_PRUNED_HEAD) M=$(BEEGFS_BUILDDIR)/../source \
"EXTRA_CFLAGS=$(BEEGFS_CFLAGS)" modules "EXTRA_CFLAGS=$(BEEGFS_CFLAGS)" modules
@cp ../source/$(TARGET).ko . @cp ../source/$(TARGET).ko .
......
# BeeGFS client module DKMS build configuration
# This file is only used when building via DKMS.
# The module needs to be rebuilt after this file has been changed.
# If using thirdparty OFED specify the path to the installation here.
# Examples:
#OFED_INCLUDE_PATH=/usr/src/ofa_kernel/default/include
#OFED_INCLUDE_PATH=/usr/src/openib/include
...@@ -154,7 +154,12 @@ ...@@ -154,7 +154,12 @@
#if defined(KERNEL_HAS_64BIT_TIMESTAMPS) #if defined(KERNEL_HAS_64BIT_TIMESTAMPS)
static inline struct timespec64 current_fs_time(struct super_block *sb) static inline struct timespec64 current_fs_time(struct super_block *sb)
{ {
#if defined(KERNEL_HAS_KTIME_GET)
struct timespec64 now;
ktime_get_real_ts64(&now);
#else
struct timespec64 now = current_kernel_time64(); struct timespec64 now = current_kernel_time64();
#endif /* KERNEL_HAS_KTIME_GET */
return timespec64_trunc(now, sb->s_time_gran); return timespec64_trunc(now, sb->s_time_gran);
} }
#elif !defined(KERNEL_HAS_CURRENT_FS_TIME) #elif !defined(KERNEL_HAS_CURRENT_FS_TIME)
......
...@@ -707,6 +707,9 @@ void __IBVSocket_cleanupCommContext(struct rdma_cm_id* cm_id, IBVCommContext* co ...@@ -707,6 +707,9 @@ void __IBVSocket_cleanupCommContext(struct rdma_cm_id* cm_id, IBVCommContext* co
if(commContext->sendCQ) if(commContext->sendCQ)
#ifdef KERNEL_IB_DESTROY_CQ_IS_VOID
ib_destroy_cq(commContext->sendCQ);
#else
{ {
int destroyRes = ib_destroy_cq(commContext->sendCQ); int destroyRes = ib_destroy_cq(commContext->sendCQ);
if (unlikely(destroyRes) ) if (unlikely(destroyRes) )
...@@ -715,8 +718,12 @@ void __IBVSocket_cleanupCommContext(struct rdma_cm_id* cm_id, IBVCommContext* co ...@@ -715,8 +718,12 @@ void __IBVSocket_cleanupCommContext(struct rdma_cm_id* cm_id, IBVCommContext* co
dump_stack(); dump_stack();
} }
} }
#endif
if(commContext->recvCQ) if(commContext->recvCQ)
#ifdef KERNEL_IB_DESTROY_CQ_IS_VOID
ib_destroy_cq(commContext->recvCQ);
#else
{ {
int destroyRes = ib_destroy_cq(commContext->recvCQ); int destroyRes = ib_destroy_cq(commContext->recvCQ);
if (unlikely(destroyRes) ) if (unlikely(destroyRes) )
...@@ -725,6 +732,7 @@ void __IBVSocket_cleanupCommContext(struct rdma_cm_id* cm_id, IBVCommContext* co ...@@ -725,6 +732,7 @@ void __IBVSocket_cleanupCommContext(struct rdma_cm_id* cm_id, IBVCommContext* co
dump_stack(); dump_stack();
} }
} }
#endif
IBVBuffer_free(&commContext->checkConBuffer, commContext); IBVBuffer_free(&commContext->checkConBuffer, commContext);
......
...@@ -11,7 +11,7 @@ void FileEvent_init(struct FileEvent* event, enum FileEventType eventType, struc ...@@ -11,7 +11,7 @@ void FileEvent_init(struct FileEvent* event, enum FileEventType eventType, struc
if (!dentry) if (!dentry)
return; return;
event->pathPagePFN = __get_free_page(GFP_NOFS); event->pathPagePFN = (unsigned long) kmalloc(4096, GFP_NOFS);
if (!event->pathPagePFN) if (!event->pathPagePFN)
return; return;
...@@ -23,7 +23,7 @@ void FileEvent_init(struct FileEvent* event, enum FileEventType eventType, struc ...@@ -23,7 +23,7 @@ void FileEvent_init(struct FileEvent* event, enum FileEventType eventType, struc
void FileEvent_uninit(struct FileEvent* event) void FileEvent_uninit(struct FileEvent* event)
{ {
if (event->pathPagePFN) if (event->pathPagePFN)
free_page(event->pathPagePFN); kfree((void *)event->pathPagePFN);
FileEvent_setTargetStr(event, NULL); FileEvent_setTargetStr(event, NULL);
} }
...@@ -35,7 +35,7 @@ void FileEvent_setTargetDentry(struct FileEvent* event, struct dentry* dentry) ...@@ -35,7 +35,7 @@ void FileEvent_setTargetDentry(struct FileEvent* event, struct dentry* dentry)
if (!dentry) if (!dentry)
return; return;
event->targetPagePFN = __get_free_page(GFP_NOFS); event->targetPagePFN = (unsigned long) kmalloc(4096, GFP_NOFS);
if (!event->targetPagePFN) if (!event->targetPagePFN)
return; return;
......
...@@ -37,7 +37,7 @@ void FileEvent_uninit(struct FileEvent* event); ...@@ -37,7 +37,7 @@ void FileEvent_uninit(struct FileEvent* event);
static inline void FileEvent_setTargetStr(struct FileEvent* event, const char* target) static inline void FileEvent_setTargetStr(struct FileEvent* event, const char* target)
{ {
if (event->targetPagePFN) if (event->targetPagePFN)
free_page(event->targetPagePFN); kfree((void *)event->targetPagePFN);
else else
kfree(event->target); kfree(event->target);
......
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
void TimeAbs_init(TimeAbs* this) void TimeAbs_init(TimeAbs* this)
{ {
struct timeval now; struct timeval now;
#if defined(KERNEL_HAS_KTIME_GET)
now = ktime_to_timeval(ktime_get_real());
#else
do_gettimeofday(&now); do_gettimeofday(&now);
#endif
this->now.tv_sec = now.tv_sec; this->now.tv_sec = now.tv_sec;
this->now.tv_usec = now.tv_usec; this->now.tv_usec = now.tv_usec;
......
...@@ -301,7 +301,7 @@ int FhgfsOps_readlink(struct dentry* dentry, char __user* buf, int size) ...@@ -301,7 +301,7 @@ int FhgfsOps_readlink(struct dentry* dentry, char __user* buf, int size)
FhgfsOpsHelper_logOp(5, app, dentry, inode, logContext); FhgfsOpsHelper_logOp(5, app, dentry, inode, logContext);
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_WRITE, buf, size) ) ) if(unlikely(!os_access_ok(VERIFY_WRITE, buf, size) ) )
return -EFAULT; return -EFAULT;
FhgfsInode_entryInfoReadLock(fhgfsInode); // LOCK EntryInfo FhgfsInode_entryInfoReadLock(fhgfsInode); // LOCK EntryInfo
......
...@@ -194,7 +194,7 @@ static long FhgfsOpsIoctl_getCfgFile(struct file *file, void __user *argp) ...@@ -194,7 +194,7 @@ static long FhgfsOpsIoctl_getCfgFile(struct file *file, void __user *argp)
return -EINVAL; return -EINVAL;
} }
if(!access_ok(VERIFY_WRITE, confFile, sizeof(*confFile) ) ) if(!os_access_ok(VERIFY_WRITE, confFile, sizeof(*confFile) ) )
{ {
Logger_logFormatted(log, Log_DEBUG, logContext, "access_ok() denied to write to conf_file"); Logger_logFormatted(log, Log_DEBUG, logContext, "access_ok() denied to write to conf_file");
return -EINVAL; return -EINVAL;
...@@ -230,7 +230,7 @@ static long FhgfsOpsIoctl_getRuntimeCfgFile(struct file *file, void __user *argp ...@@ -230,7 +230,7 @@ static long FhgfsOpsIoctl_getRuntimeCfgFile(struct file *file, void __user *argp
int cpRes; int cpRes;
int cfgFileStrLen; int cfgFileStrLen;
if(!access_ok(VERIFY_WRITE, confFile, sizeof(*confFile) ) ) if(!os_access_ok(VERIFY_WRITE, confFile, sizeof(*confFile) ) )
{ {
Logger_logFormatted(log, Log_DEBUG, logContext, "access_ok() denied to write to conf_file"); Logger_logFormatted(log, Log_DEBUG, logContext, "access_ok() denied to write to conf_file");
vfree(fileName); vfree(fileName);
......
...@@ -281,7 +281,11 @@ int FhgfsOps_fillSuper(struct super_block* sb, void* rawMountOptions, int silent ...@@ -281,7 +281,11 @@ int FhgfsOps_fillSuper(struct super_block* sb, void* rawMountOptions, int silent
sb->s_magic = BEEGFS_MAGIC; sb->s_magic = BEEGFS_MAGIC;
sb->s_op = &fhgfs_super_ops; sb->s_op = &fhgfs_super_ops;
sb->s_time_gran = 1000000000; // granularity of c/m/atime in ns sb->s_time_gran = 1000000000; // granularity of c/m/atime in ns
#ifdef KERNEL_HAS_SB_NODIRATIME
sb->s_flags |= SB_NODIRATIME;
#else
sb->s_flags |= MS_NODIRATIME; sb->s_flags |= MS_NODIRATIME;
#endif
if (Config_getSysXAttrsEnabled(cfg ) ) if (Config_getSysXAttrsEnabled(cfg ) )
sb->s_xattr = fhgfs_xattr_handlers_noacl; // handle only user xattrs sb->s_xattr = fhgfs_xattr_handlers_noacl; // handle only user xattrs
......
...@@ -465,7 +465,7 @@ ssize_t __ProcFs_writeV2_connRetriesEnabled(struct file *file, const char __user ...@@ -465,7 +465,7 @@ ssize_t __ProcFs_writeV2_connRetriesEnabled(struct file *file, const char __user
App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir) App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir)
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_connRetriesEnabled(buf, count, app); return ProcFsHelper_write_connRetriesEnabled(buf, count, app);
...@@ -478,7 +478,7 @@ int ProcFs_write_connRetriesEnabled(struct file* file, const char __user *buf, ...@@ -478,7 +478,7 @@ int ProcFs_write_connRetriesEnabled(struct file* file, const char __user *buf,
unsigned long count, void* data) unsigned long count, void* data)
{ {
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_connRetriesEnabled(buf, count, (App*)data); return ProcFsHelper_write_connRetriesEnabled(buf, count, (App*)data);
...@@ -507,7 +507,7 @@ ssize_t __ProcFs_writeV2_netBenchModeEnabled(struct file *file, const char __use ...@@ -507,7 +507,7 @@ ssize_t __ProcFs_writeV2_netBenchModeEnabled(struct file *file, const char __use
App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir) App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir)
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_netBenchModeEnabled(buf, count, app); return ProcFsHelper_write_netBenchModeEnabled(buf, count, app);
...@@ -520,7 +520,7 @@ int ProcFs_write_netBenchModeEnabled(struct file* file, const char __user *buf, ...@@ -520,7 +520,7 @@ int ProcFs_write_netBenchModeEnabled(struct file* file, const char __user *buf,
unsigned long count, void* data) unsigned long count, void* data)
{ {
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_netBenchModeEnabled(buf, count, (App*)data); return ProcFsHelper_write_netBenchModeEnabled(buf, count, (App*)data);
...@@ -533,7 +533,7 @@ ssize_t __ProcFs_writeV2_dropConns(struct file *file, const char __user *buf, ...@@ -533,7 +533,7 @@ ssize_t __ProcFs_writeV2_dropConns(struct file *file, const char __user *buf,
App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir) App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir)
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_dropConns(buf, count, app); return ProcFsHelper_write_dropConns(buf, count, app);
...@@ -546,7 +546,7 @@ int ProcFs_write_dropConns(struct file* file, const char __user *buf, ...@@ -546,7 +546,7 @@ int ProcFs_write_dropConns(struct file* file, const char __user *buf,
unsigned long count, void* data) unsigned long count, void* data)
{ {
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_dropConns(buf, count, (App*)data); return ProcFsHelper_write_dropConns(buf, count, (App*)data);
...@@ -575,7 +575,7 @@ ssize_t __ProcFs_writeV2_logLevels(struct file *file, const char __user *buf, ...@@ -575,7 +575,7 @@ ssize_t __ProcFs_writeV2_logLevels(struct file *file, const char __user *buf,
App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir) App* app = __ProcFs_getProcParentDirEntryDataField(procInode); // (app is ->data in parent dir)
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_logLevels(buf, count, app); return ProcFsHelper_write_logLevels(buf, count, app);
...@@ -588,7 +588,7 @@ int ProcFs_write_logLevels(struct file* file, const char __user *buf, ...@@ -588,7 +588,7 @@ int ProcFs_write_logLevels(struct file* file, const char __user *buf,
unsigned long count, void* data) unsigned long count, void* data)
{ {
// check user buffer // check user buffer
if(unlikely(!access_ok(VERIFY_READ, buf, count) ) ) if(unlikely(!os_access_ok(VERIFY_READ, buf, count) ) )
return -EFAULT; return -EFAULT;
return ProcFsHelper_write_logLevels(buf, count, (App*)data); return ProcFsHelper_write_logLevels(buf, count, (App*)data);
......
...@@ -299,4 +299,12 @@ static inline void os_inode_unlock(struct inode* inode) ...@@ -299,4 +299,12 @@ static inline void os_inode_unlock(struct inode* inode)
} }
#endif #endif
#if defined(KERNEL_ACCESS_OK_WANTS_TYPE)
# define os_access_ok(type, addr, size) access_ok(type, addr, size)
#else
# define os_access_ok(type, addr, size) access_ok(addr, size)
#endif
#endif /* OSCOMPAT_H_ */ #endif /* OSCOMPAT_H_ */
...@@ -19,7 +19,10 @@ ...@@ -19,7 +19,10 @@
#ifdef BEEGFS_DEBUG #ifdef BEEGFS_DEBUG
#if defined CONFIG_STACKTRACE // kernel has stacktrace support // Significant parts of the kernel code around struct stack_trace are removed
// when CONFIG_ARCH_STACKWALK is set. Code below needs to be rewritten to work
// with newer kernels that have CONFIG_ARCH_STACKWALK enabled.
#if defined CONFIG_STACKTRACE && !defined CONFIG_ARCH_STACKWALK
/** /**
* Save a given trace. NOTE: Allocated memory has to be freed later on! * Save a given trace. NOTE: Allocated memory has to be freed later on!
...@@ -80,7 +83,7 @@ void os_printStackTrace(void* trace, int spaces) ...@@ -80,7 +83,7 @@ void os_printStackTrace(void* trace, int spaces)
} }
#else // no CONFIG_STACKTRACE => nothing to do at all #else // no CONFIG_STACKTRACE or CONFIG_ARCH_STACKWALK enabled => nothing to do at all
void* os_saveStackTrace(void) void* os_saveStackTrace(void)
{ {
...@@ -98,7 +101,7 @@ void os_freeStackTrace(void* trace) ...@@ -98,7 +101,7 @@ void os_freeStackTrace(void* trace)
return; return;
} }
#endif // CONFIG_STACKTRACE #endif // CONFIG_STACKTRACE && !CONFIG_ARCH_STACKWALK
#endif // BEEGFS_DEBUG #endif // BEEGFS_DEBUG
......
...@@ -98,3 +98,4 @@ MODULE_LICENSE(BEEGFS_LICENSE); ...@@ -98,3 +98,4 @@ MODULE_LICENSE(BEEGFS_LICENSE);
MODULE_DESCRIPTION("BeeGFS parallel file system client (http://www.beegfs.com)"); MODULE_DESCRIPTION("BeeGFS parallel file system client (http://www.beegfs.com)");
MODULE_AUTHOR("Fraunhofer ITWM, CC-HPC"); MODULE_AUTHOR("Fraunhofer ITWM, CC-HPC");
MODULE_ALIAS("fs-" BEEGFS_MODULE_NAME_STR); MODULE_ALIAS("fs-" BEEGFS_MODULE_NAME_STR);
MODULE_VERSION(BEEGFS_VERSION);
...@@ -402,7 +402,7 @@ std::string MsgHelperGenericDebug::processOpListTargetStates(std::istringstream& ...@@ -402,7 +402,7 @@ std::string MsgHelperGenericDebug::processOpListTargetStates(std::istringstream&
for (ZipConstIterRange<UInt16List, UInt8List, UInt8List> for (ZipConstIterRange<UInt16List, UInt8List, UInt8List>
iter(targetIDs, targetReachabilityStates, targetConsistencyStates); iter(targetIDs, targetReachabilityStates, targetConsistencyStates);
iter.empty(); ++iter) !iter.empty(); ++iter)
{ {
returnStream << *iter()->first << " " returnStream << *iter()->first << " "
<< TargetStateStore::stateToStr( (TargetReachabilityState)*iter()->second) << " " << TargetStateStore::stateToStr( (TargetReachabilityState)*iter()->second) << " "
......
...@@ -7,18 +7,19 @@ ...@@ -7,18 +7,19 @@
#include <common/storage/Metadata.h> #include <common/storage/Metadata.h>
#include <common/toolkit/MessagingTk.h> #include <common/toolkit/MessagingTk.h>