Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile for 4.18.1 kernel #136

Open
alphazo opened this issue Aug 17, 2018 · 7 comments
Open

Unable to compile for 4.18.1 kernel #136

alphazo opened this issue Aug 17, 2018 · 7 comments

Comments

@alphazo
Copy link

alphazo commented Aug 17, 2018

I've been using exfat-nofuse for a long time but something seems to be broken with 4.18.1 kernel:

DKMS make.log for exfat-198.01c30ad for kernel 4.18.1-arch1-1-ARCH (x86_64)
Fri Aug 17 22:22:51 CEST 2018
make -C /usr/lib/modules/4.18.1-arch1-1-ARCH/build M=/var/lib/dkms/exfat/198.01c30ad/build modules
make[1] : on entre dans le répertoire « /usr/lib/modules/4.18.1-arch1-1-ARCH/build »
  CC [M]  /var/lib/dkms/exfat/198.01c30ad/build/exfat_core.o
  CC [M]  /var/lib/dkms/exfat/198.01c30ad/build/exfat_super.o
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c: Dans la fonction « exfat_fill_inode »:
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c:1927:27: error: passage de l'argument 2 de « exfat_time_fat2unix » depuis un type pointeur incompatible [-Werror=incompatible-pointer-typ
es]
  exfat_time_fat2unix(sbi, &inode->i_mtime, &info.ModifyTimestamp);
                           ^~~~~~~~~~~~~~~
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c:150:70: note: « struct timespec * » attendu mais l'argument est de type « struct timespec64 * »
 void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
                                                     ~~~~~~~~~~~~~~~~~^~
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c:1928:27: error: passage de l'argument 2 de « exfat_time_fat2unix » depuis un type pointeur incompatible [-Werror=incompatible-pointer-typ
es]
  exfat_time_fat2unix(sbi, &inode->i_ctime, &info.CreateTimestamp);
                           ^~~~~~~~~~~~~~~
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c:150:70: note: « struct timespec * » attendu mais l'argument est de type « struct timespec64 * »
 void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
                                                     ~~~~~~~~~~~~~~~~~^~
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c:1929:27: error: passage de l'argument 2 de « exfat_time_fat2unix » depuis un type pointeur incompatible [-Werror=incompatible-pointer-typ
es]
  exfat_time_fat2unix(sbi, &inode->i_atime, &info.AccessTimestamp);
                           ^~~~~~~~~~~~~~~
/var/lib/dkms/exfat/198.01c30ad/build/exfat_super.c:150:70: note: « struct timespec * » attendu mais l'argument est de type « struct timespec64 * »
 void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,

@alphazo
Copy link
Author

alphazo commented Aug 18, 2018

Thanks @barrybingo. You saved my day since I couldn't copy a bunch of photos from my SD card. I hope this simple fix goes to mainstream soon.

@CodeUnit
Copy link

CodeUnit commented Sep 6, 2018

Here my timespec64 patch:

index 312de36..6c097f5 100644
--- a/exfat_super.c
+++ b/exfat_super.c
@@ -147,8 +147,13 @@ static time_t accum_days_in_year[] = {
 static void _exfat_truncate(struct inode *inode, loff_t old_size);
 
 /* Convert a FAT time/date pair to a UNIX date (seconds since 1 1 70). */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)
+void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec64 *ts,
+						 DATE_TIME_T *tp)
+#else
 void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
 						 DATE_TIME_T *tp)
+#endif
 {
 	time_t year = tp->Year;
 	time_t ld;
@@ -166,8 +171,13 @@ void exfat_time_fat2unix(struct exfat_sb_info *sbi, struct timespec *ts,
 }
 
 /* Convert linear UNIX date to a FAT time/date pair. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)
+void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec64 *ts,
+						 DATE_TIME_T *tp)
+#else
 void exfat_time_unix2fat(struct exfat_sb_info *sbi, struct timespec *ts,
 						 DATE_TIME_T *tp)
+#endif
 {
 	time_t second = ts->tv_sec;
 	time_t day, month, year;

@btaroli
Copy link

btaroli commented Sep 20, 2018

Hoping this makes it into the project soon... having to manually patch each time I upgrade the kernel lately... 4.18.7 now.. 😉

@ddscentral
Copy link

ddscentral commented Oct 24, 2018

Same issue with the new kernel 4.19. In addition to the provided patch, you also need to replace timespec with timespec64 and ktime_get_real_ts with ktime_get_real_ts64 in exfat_oal.c. I'll try to make a proper patch later.

@tommyjcarpenter
Copy link

tommyjcarpenter commented Dec 31, 2018

@barrybingo I was using your local branch for the past several months, but it has failed for me on 4.20. There is only one compilation error:

/home/tommy/exfat-nofuse/exfat_oal.c: In function ‘tm_current’:
/home/tommy/exfat-nofuse/exfat_oal.c:137:2: error: implicit declaration of function ‘ktime_get_real_ts’; did you mean ‘ktime_get_real_ns’? [-Werror=implicit-function-declaration]
  ktime_get_real_ts(&ts);
  ^~~~~~~~~~~~~~~~~
  ktime_get_real_ns

EDIT: thanks @ddscentral if you apply those two changes to @barrybingo branch it works! I've made a PR here: barrybingo#1

@ddscentral
Copy link

ddscentral commented Dec 31, 2018 via email

@tommyjcarpenter
Copy link

@ddscentral yes I saw @barrybingo has updated so I will go back to using that branch. Hopefully the arch package exfat-dkms-git gets fixed, or changed to barry's upstream, because that package has been broken for months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants