From patchwork Wed Dec 18 16:39:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11301409 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43D4F139A for ; Wed, 18 Dec 2019 16:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2188E227BF for ; Wed, 18 Dec 2019 16:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727217AbfLRQkJ (ORCPT ); Wed, 18 Dec 2019 11:40:09 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:40215 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbfLRQkJ (ORCPT ); Wed, 18 Dec 2019 11:40:09 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MRTIx-1iMu9G3WSb-00NRZ9; Wed, 18 Dec 2019 17:39:55 +0100 From: Arnd Bergmann To: "Darrick J . Wong" , linux-xfs@vger.kernel.org Cc: y2038@lists.linaro.org, Arnd Bergmann , Brian Foster , Eric Sandeen , Allison Collins , Nick Bowler , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] xfs: rename compat_time_t to old_time32_t Date: Wed, 18 Dec 2019 17:39:28 +0100 Message-Id: <20191218163954.296726-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:E9mF7OYDn9JyQwrHLT+pY4Y1q8BDrhiycRQ3Ygb25o5lMFAbgML r8VIN8pCIoF2EG1eS0sqGdFs16ROCCbwJCM4eSC/EYLBG0P6ZOPrM+WDns2LZkHEOt6dKVZ KigR86K6jd1IXB9Is8ld5PoRU9RZXPkHIF0Ikm07i5N+v7aolUwAq5o8tcWHEe2Aa88Ttmy llvpZ3Q1tHfVjtUL7sAfw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7cATP4CSdSk=:f9D6xz2FFGd7zqBrEqzNNr 25DzUk6VbJWMouHADDk631BIoq1VL5PSh7hi6MN7wfep+gWhhjEucBFmXuR2bO/5OCMvY4mta vqgKF5AmsMkxvawUCqaQx9jqlJYt+V0c40DieoYHeHf9vAficZdjykAMQi1lEz7IsTNnfqKFC /TMI42qGT8keVFBCOH12cYI6rMio/a0LVhxBntLzfQbCqgPdqzc2+v0ZyE/PZ7kHc204eXCmH bVIMh9B04C8NF1hVACl+DoJt9N2f0tWqd7CqzDkzS+BMWZVzCzr09i4m55OonYvDPGoegMKBm ZS7rWzAqtE1AITyw5o6qk/cphSQaBc/7tQzq7UnsXkgCCo9kZsno4XJdeh5+hnkIlX2Ob4wJX RajGiL1S3Kv35a3gUDWFM8zdebH4mahgIsiZGUIkOKeiBHfbiL1G9VyGq0QSTbRnSHM5x+SQi mHVSlXEaCQ39FQVNDnBpUJRRlssjqUHB9ShEY3V8+j19mYM0hnRGqAShlC+fo3QJXfDe4CGlM TfhaUyhamZXOXWxHWrFajja0AaRBC3L0vLcbJE4hS5kn1BGLng2eLIdq3gLwR457YQKuZh04O D7x6Wbf7HocsfpQu2rOdNz9uV3KHehT/U7FnUHY7FcNNXKARfZgRf8GOHj/zc6teMnBwp1k9o Ngk6ivNWG315zPJL7eah7wniA6dIDSAQXeXMgf6p5/QOWfpB5l+vV6k/lp8gpQ6mLSXyIKiAS B0NPEgoYzzGoK1y+rI4p/pShuZcq0fMxeraEw/VyuYarTKmEP3YlNUnzzkYY2A37KPWbwOTBW v4KERGsd9uBcow2SO2fhq7ww64iL5AdyKwz7i1X0lQhBkxO8+1QRZjn7l5nQyxZFmQpH3fTxd fVGYeDs4N4d/GOxBRhYQ== Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org The compat_time_t type has been removed everywhere else, as most users rely on old_time32_t for both native and compat mode handling of 32-bit time_t. Remove the last one in xfs. Reviewed-by: Darrick J. Wong Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_ioctl32.c | 2 +- fs/xfs/xfs_ioctl32.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index c4c4f09113d3..a49bd80b2c3b 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c @@ -107,7 +107,7 @@ xfs_ioctl32_bstime_copyin( xfs_bstime_t *bstime, compat_xfs_bstime_t __user *bstime32) { - compat_time_t sec32; /* tv_sec differs on 64 vs. 32 */ + old_time32_t sec32; /* tv_sec differs on 64 vs. 32 */ if (get_user(sec32, &bstime32->tv_sec) || get_user(bstime->tv_nsec, &bstime32->tv_nsec)) diff --git a/fs/xfs/xfs_ioctl32.h b/fs/xfs/xfs_ioctl32.h index 8c7743cd490e..053de7d894cd 100644 --- a/fs/xfs/xfs_ioctl32.h +++ b/fs/xfs/xfs_ioctl32.h @@ -32,7 +32,7 @@ #endif typedef struct compat_xfs_bstime { - compat_time_t tv_sec; /* seconds */ + old_time32_t tv_sec; /* seconds */ __s32 tv_nsec; /* and nanoseconds */ } compat_xfs_bstime_t; From patchwork Wed Dec 18 16:39:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11301413 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3F6B138C for ; Wed, 18 Dec 2019 16:40:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC2FB24672 for ; Wed, 18 Dec 2019 16:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727184AbfLRQkR (ORCPT ); Wed, 18 Dec 2019 11:40:17 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:44199 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727124AbfLRQkQ (ORCPT ); Wed, 18 Dec 2019 11:40:16 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MUGqT-1iGuOr0t6J-00RLZB; Wed, 18 Dec 2019 17:40:06 +0100 From: Arnd Bergmann To: "Darrick J . Wong" , linux-xfs@vger.kernel.org Cc: y2038@lists.linaro.org, Arnd Bergmann , Brian Foster , Dave Chinner , Allison Collins , Jan Kara , Eric Sandeen , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] xfs: disallow broken ioctls without compat-32-bit-time Date: Wed, 18 Dec 2019 17:39:29 +0100 Message-Id: <20191218163954.296726-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191218163954.296726-1-arnd@arndb.de> References: <20191218163954.296726-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:6ujAzFNzbSvWONOGFgSWinycKZWnfNnaCJ6HIW30mi/PzDQi6Wu hKOaMDeT4IWEcnmQSowIe92SThixIKCnshY2b1DvLkb9cwh/JBIhP6ELzY+IEBfeaBlBnvG HG/9w0pt+nFUcJUliGN/drBqfYUb9AK8V0Z8lDB4YEIiaUW8qvmH2nOUBipIWTIT+YULKl0 DLu+k/jmWAKQFz3vpL/vw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Phie+ptjyJE=:EGVmmJtbEU0+IRu25Koo9X gB6r/Vk3tbNyA1FA2jcJ0DLdt6R2yBk3mg2IZZrji+Z5pUazLPh/KswFMI50Enri0I9nE+ANH 2j1XO9is3USpw973y3vrxgDHzE6W4afEKpdgeNymEdnk1nAWMs0wGgUV7cMdUPnzq7mHSyMpJ +KNVxyeARysnFu5t2x3dzxI8dl/f3SVCUI9lAtLb0O3ZsTzNvlbeT7Kbpuv1HHRhzv4jmosd0 e9o3ImrhDWiP6UpFkFw4nwvqVFZd3IXs+fhlFENkpnc3qbZWkskLWT72/M+k8KG/rcw42UeMF m21DzColmhBoh0Ss6DYmHqPuP2jLEts6isFEdkVTUJzyL8360L9RjsbafGHgVqDc29mSyuarx kszzc7VkEvsuP/1SNOSKWb3Wa4aRTjMMocpjrtUdcjA0/uqpYL/A+OJAPwYeqhEEIPKTkkQcM /U4/BegYQ7scv2xY/ti20LtHp+ZvOZyJVnhAwmeQfXdsNQJnuJ1PAvQ45C7j5HShFVH4viDHn dtzQV9TPOLOzFj8vWBjBgTXWEJyA3z4md+oqaTnVense41w1o+rOyk9tOD57gFqtD3Y4ZQRoT T0DwiqDRmBZ2vNKPllydRgAM+ZBgPf2HMUEgeNd5axSPtvpsd3ixSuyVrpjQ6Lbvh/2DYwpSi ww5O4fRDWUP4VaQKBmtrqbl2+3f5cgjO1+raAj6AWncDatN3qQjC9DphFdTKCdLvgbOfzm+4Y wagisEsGvWUe4B5o3B8BXpDstc3oALZP8wCrFBRzI8y4EePxiQztwSQTHI70nGnuWGBoE9mNs M8C07KLky3DBhl31X5ei5Hk9Zm9VB8SHkE6GXpkM+of5Sdc2ZK2rYdMc8XF/+EGyHkwb2h8oF EQJjOtppA7S+gjkCJBRg== Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org When building a kernel that disables support for 32-bit time_t system calls, it also makes sense to disable the old xfs_bstat ioctls completely, as they truncate the timestamps to 32-bit values once the extended times are supported. Any application using these needs to be updated to use the v5 interfaces. Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_ioctl.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 7b35d62ede9f..d43582e933a0 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -36,6 +36,7 @@ #include "xfs_reflink.h" #include "xfs_ioctl.h" +#include #include #include @@ -617,6 +618,23 @@ xfs_fsinumbers_fmt( return xfs_ibulk_advance(breq, sizeof(struct xfs_inogrp)); } +/* disallow y2038-unsafe ioctls with CONFIG_COMPAT_32BIT_TIME=n */ +static bool xfs_have_compat_bstat_time32(unsigned int cmd) +{ + if (IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)) + return true; + + if (IS_ENABLED(CONFIG_64BIT) && !in_compat_syscall()) + return true; + + if (cmd == XFS_IOC_FSBULKSTAT_SINGLE || + cmd == XFS_IOC_FSBULKSTAT || + cmd == XFS_IOC_SWAPEXT) + return false; + + return true; +} + STATIC int xfs_ioc_fsbulkstat( xfs_mount_t *mp, @@ -637,6 +655,9 @@ xfs_ioc_fsbulkstat( if (!capable(CAP_SYS_ADMIN)) return -EPERM; + if (!xfs_have_compat_bstat_time32(cmd)) + return -EINVAL; + if (XFS_FORCED_SHUTDOWN(mp)) return -EIO; @@ -1815,6 +1836,11 @@ xfs_ioc_swapext( struct fd f, tmp; int error = 0; + if (!xfs_have_compat_bstat_time32(XFS_IOC_SWAPEXT)) { + error = -EINVAL; + goto out; + } + /* Pull information for the target fd */ f = fdget((int)sxp->sx_fdtarget); if (!f.file) { From patchwork Wed Dec 18 16:44:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11301435 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA3DB14E3 for ; Wed, 18 Dec 2019 16:44:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A856724650 for ; Wed, 18 Dec 2019 16:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbfLRQos (ORCPT ); Wed, 18 Dec 2019 11:44:48 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:35725 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbfLRQos (ORCPT ); Wed, 18 Dec 2019 11:44:48 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MGgRW-1iTsus1Nac-00Dsp6; Wed, 18 Dec 2019 17:44:20 +0100 From: Arnd Bergmann To: "Darrick J . Wong" , linux-xfs@vger.kernel.org Cc: y2038@lists.linaro.org, Arnd Bergmann , Brian Foster , Carlos Maiolino , Pavel Reichl , Eric Sandeen , Tetsuo Handa , Dave Chinner , Allison Collins , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] xfs: quota: move to time64_t interfaces Date: Wed, 18 Dec 2019 17:44:05 +0100 Message-Id: <20191218164418.463467-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191218163954.296726-1-arnd@arndb.de> References: <20191218163954.296726-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:FUskByiXnCTH70Q8n4XCuCHT4CPOpZnVwrXf6WYJO0e75Nr0PkI /3qYAc9i1Gb0z3DV7SD6P0CowGHqfFUAgc1InUWAjgphQascqxFczuBbwL/GN7Z76TUNqnK yv7bOtCBDc+pBvCXVUXOZ3Ig3NsqRZn6fRK7lkW3QFrj4Wuf8Xf2gp1UrycHD7XJ5MQsQ8C StzNKoNY4xo73FADLxmUA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:CJHPKKZvaj8=:951edUD5nPzOwVPTUhUzTo Na8wsKech0H1SPSyDKfyESXK+qPEGA6OnlRj0aHs5dOX3SoOLrUqx8HzJQ6aglzju7+HIncJT yBRJgnGP7JRUgHk2tksC0ucChGYjSUJqsPkbFrDlXo18m5COvHH9u6mVbSBVCGpgjLHGZyyDE rLcVEiz+OWpFFSFXQdTlNYAm4gFYn2Mj0fvk/s/82K7He1tfA+JlL4WJNq4Vpnzy+ZcYDZpCv 9eSZ+gmFRGhWXeTc+6RUVeJ5cDSk0K2DPSb8KSnCW5GvqSucWZWSz6CDKEOPtsVI89k8AW8h1 Hy2WhVUpuaKGbWcqUs3OAmBtHqNnSOP5BMsE9u4E553ADYtzFgzRnQM4MCWcR/L+R59lgStGg JI0F0C29gdeTnrGRKWpaj7Gv9tW5LeQPGRSlqOovqnJbSOSRV6ZwAs/cQSmn4E9r/78ZYOrff Yu7ooH71Xb18C0F9KF/kJrZPVeapR4OnXCVRzZgdDoFeynb62+5TpICCNl+ISo/A6S5so2vs7 WKXoR7fWfHUlPqNryVYikAVwLrIRNDKZ44vVwuAjDCfIpZZye+rw+0wjMrnI93MpAOmoy2P+/ V0dH7JFrIWu6rVPhdMDLrKV/UasnYN7sLDmdw+Vexi7CTbS5s9gRZpeazWHLC6RlYcrmdiv0o 1zAHJrJqaVlGfqldsCksKwh0i6OnEaoBfWSnZeP1OCljlz3gbm2Cce2PIsXD1uSFkeq3beX7R /zx/jI4DDP1d4MUr/kiojBi0h4qOzEE+psQzHOLYVBypfxwAkD+pVLiqehJ/gvmM44bhzkObA QcyKcWjd71X3+kXy7nZYqn2DsoSfhSD93OWyCbRmau7YIpcm4+8h7VKgty1JAxfMFAa1778bp 1gxy1cBGfoEw15O0qs9w== Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org As a preparation for removing the 32-bit time_t type and all associated interfaces, change xfs to use time64_t and ktime_get_real_seconds() for the quota housekeeping. This avoids one difference between 32-bit and 64-bit kernels, raising the theoretical limit for the quota grace period to year 2106 on 32-bit instead of year 2038. Note that common user space tools using the XFS quotactl interface instead of the generic one still use the y2038 dates. To fix quotas properly, both the on-disk format and user space still need to be changed. Signed-off-by: Arnd Bergmann --- fs/xfs/xfs_dquot.c | 6 +++--- fs/xfs/xfs_qm.h | 6 +++--- fs/xfs/xfs_quotaops.c | 6 +++--- fs/xfs/xfs_trans_dquot.c | 8 +++++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 2bff21ca9d78..9cfd3209f52b 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -137,7 +137,7 @@ xfs_qm_adjust_dqtimers( (d->d_blk_hardlimit && (be64_to_cpu(d->d_bcount) > be64_to_cpu(d->d_blk_hardlimit)))) { - d->d_btimer = cpu_to_be32(get_seconds() + + d->d_btimer = cpu_to_be32(ktime_get_real_seconds() + mp->m_quotainfo->qi_btimelimit); } else { d->d_bwarns = 0; @@ -160,7 +160,7 @@ xfs_qm_adjust_dqtimers( (d->d_ino_hardlimit && (be64_to_cpu(d->d_icount) > be64_to_cpu(d->d_ino_hardlimit)))) { - d->d_itimer = cpu_to_be32(get_seconds() + + d->d_itimer = cpu_to_be32(ktime_get_real_seconds() + mp->m_quotainfo->qi_itimelimit); } else { d->d_iwarns = 0; @@ -183,7 +183,7 @@ xfs_qm_adjust_dqtimers( (d->d_rtb_hardlimit && (be64_to_cpu(d->d_rtbcount) > be64_to_cpu(d->d_rtb_hardlimit)))) { - d->d_rtbtimer = cpu_to_be32(get_seconds() + + d->d_rtbtimer = cpu_to_be32(ktime_get_real_seconds() + mp->m_quotainfo->qi_rtbtimelimit); } else { d->d_rtbwarns = 0; diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h index 7823af39008b..4e57edca8bce 100644 --- a/fs/xfs/xfs_qm.h +++ b/fs/xfs/xfs_qm.h @@ -64,9 +64,9 @@ struct xfs_quotainfo { struct xfs_inode *qi_pquotaip; /* project quota inode */ struct list_lru qi_lru; int qi_dquots; - time_t qi_btimelimit; /* limit for blks timer */ - time_t qi_itimelimit; /* limit for inodes timer */ - time_t qi_rtbtimelimit;/* limit for rt blks timer */ + time64_t qi_btimelimit; /* limit for blks timer */ + time64_t qi_itimelimit; /* limit for inodes timer */ + time64_t qi_rtbtimelimit;/* limit for rt blks timer */ xfs_qwarncnt_t qi_bwarnlimit; /* limit for blks warnings */ xfs_qwarncnt_t qi_iwarnlimit; /* limit for inodes warnings */ xfs_qwarncnt_t qi_rtbwarnlimit;/* limit for rt blks warnings */ diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c index c7de17deeae6..38669e827206 100644 --- a/fs/xfs/xfs_quotaops.c +++ b/fs/xfs/xfs_quotaops.c @@ -37,9 +37,9 @@ xfs_qm_fill_state( tstate->flags |= QCI_SYSFILE; tstate->blocks = ip->i_d.di_nblocks; tstate->nextents = ip->i_d.di_nextents; - tstate->spc_timelimit = q->qi_btimelimit; - tstate->ino_timelimit = q->qi_itimelimit; - tstate->rt_spc_timelimit = q->qi_rtbtimelimit; + tstate->spc_timelimit = (u32)q->qi_btimelimit; + tstate->ino_timelimit = (u32)q->qi_itimelimit; + tstate->rt_spc_timelimit = (u32)q->qi_rtbtimelimit; tstate->spc_warnlimit = q->qi_bwarnlimit; tstate->ino_warnlimit = q->qi_iwarnlimit; tstate->rt_spc_warnlimit = q->qi_rtbwarnlimit; diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index a6fe2d8dc40f..d1b9869bc5fa 100644 --- a/fs/xfs/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c @@ -580,7 +580,7 @@ xfs_trans_dqresv( { xfs_qcnt_t hardlimit; xfs_qcnt_t softlimit; - time_t timer; + time64_t timer; xfs_qwarncnt_t warns; xfs_qwarncnt_t warnlimit; xfs_qcnt_t total_count; @@ -635,7 +635,8 @@ xfs_trans_dqresv( goto error_return; } if (softlimit && total_count > softlimit) { - if ((timer != 0 && get_seconds() > timer) || + if ((timer != 0 && + ktime_get_real_seconds() > timer) || (warns != 0 && warns >= warnlimit)) { xfs_quota_warn(mp, dqp, QUOTA_NL_BSOFTLONGWARN); @@ -662,7 +663,8 @@ xfs_trans_dqresv( goto error_return; } if (softlimit && total_count > softlimit) { - if ((timer != 0 && get_seconds() > timer) || + if ((timer != 0 && + ktime_get_real_seconds() > timer) || (warns != 0 && warns >= warnlimit)) { xfs_quota_warn(mp, dqp, QUOTA_NL_ISOFTLONGWARN);