Open alphazo opened 5 years ago
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.
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;
Hoping this makes it into the project soon... having to manually patch each time I upgrade the kernel lately... 4.18.7 now.. :wink:
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.
@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: https://github.com/barrybingo/exfat-nofuse/pull/1
I hand-patched the driver on one of my devices because I needed to get the driver working ASAP. I didn't have time to make a proper patch, sorry.
Barrybingo's repo already includes a patch from CodeUnit (it's missing ifdefs though) to fix timespec64 errors. Your patch fixes exfat_oal.c errors. This should be enough to make exfat work on 4.20.
Be aware though, that to avoid breaking exfat-nofuse for older kernels, you should add ifdefs instead of just patching existing code.
See CodeUnit's patch here: https://github.com/dorimanx/exfat-nofuse/issues/136#issuecomment-419014014
I would also fix Barrybingo's patch since it's missing ifdefs and potentially breaks support for older kernels.
On 12/31/2018 3:02 PM, Tommy Carpenter wrote:
@ddscentralhttps://github.com/ddscentral do you have a proper working patch for 4.20?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dorimanx/exfat-nofuse/issues/136#issuecomment-450643411, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZN9D75L6ZtcPPWtKmVbMQdAR3VD_pgOks5u-gragaJpZM4WCJrG.
@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.
I've been using exfat-nofuse for a long time but something seems to be broken with 4.18.1 kernel: