Dear Customer,
Courier was unable to deliver the parcel to you.
Delivery Label is attached to this email.
Thanks and best regards,
Don West,
FedEx Station Agent.
Dear Customer,
We could not deliver your item.
You can review complete details of your order in the find attached.
Kind regards,
Eric Chandler,
Sr. Operation Agent.
Dear Customer,
We could not deliver your item.
Please, open email attachment to print shipment label.
Yours faithfully,
Herbert Higgins,
FedEx Operation Manager.
When trying to build a kernel with time_t commented out, I found that
the ntp subsystem still relies on timespec for its pps handling.
This series addresses this and converts all the code to use timespec64
instead, step by step. There is one device driver that interacts with
this code directly (rather than only through the ptp subsystem), so
I have to convert that driver at the same time.
The patches should ideally stay together as a series, but they do
span multiple subsystems, so I'm also looking for the right person
to merge them.
Please review.
Thanks,
Arnd
Arnd Bergmann (5):
ntp/pps: use timespec64 for hardpps()
ntp/pps: replace getnstime_raw_and_real with 64-bit version
ntp: use timespec64 in sync_cmos_clock
ntp/pps: use y2038 safe types in pps_event_time
net: sfc: avoid using timespec
drivers/net/ethernet/sfc/ptp.c | 30 +++++++++++++++---------------
drivers/pps/kapi.c | 4 ++--
include/linux/pps_kernel.h | 16 ++++++++--------
include/linux/timekeeping.h | 4 ++--
include/linux/timex.h | 2 +-
kernel/time/ntp.c | 16 ++++++++--------
kernel/time/ntp_internal.h | 2 +-
kernel/time/timekeeping.c | 14 +++++++-------
8 files changed, 44 insertions(+), 44 deletions(-)
--
2.1.0.rc2
create_request_message() computes the maximum length of a message,
but uses the wrong type for the time stamp: sizeof(struct timespec)
may be 8 or 16 depending on the architecture, while sizeof(struct
ceph_timespec) is always 8, and that is what gets put into the
message.
Found while auditing the uses of timespec for y2038 problems.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Fixes: b8e69066d8af ("ceph: include time stamp in every MDS request")
---
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 51cb02da75d9..fe2c982764e7 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1935,7 +1935,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
len = sizeof(*head) +
pathlen1 + pathlen2 + 2*(1 + sizeof(u32) + sizeof(u64)) +
- sizeof(struct timespec);
+ sizeof(struct ceph_timespec);
/* calculate (max) length for cap releases */
len += sizeof(struct ceph_mds_request_release) *
WILC_Time is not used and also time_t is not y2038 safe, therefore remove it.
Also remove comment refering to it.
Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic(a)gmail.com>
---
drivers/staging/wilc1000/wilc_platform.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 1e56973..83f309d 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -33,8 +33,6 @@ typedef struct __MessageQueue_struct {
-/*Time represented in 64 bit format*/
-typedef time_t WILC_Time;
/*******************************************************************
--
1.9.1
First of all, sorry for the overly long series that this turned into.
I'm currently doing a survey of all code using time_t/timeval/timespec
to get an idea of what work needs to be done where, in particular in
terms of user interface changes.
Lustre is by far the most pervasive user of time types and functions,
and I could not even find my way through the code to see what needs
to be done other than actually doing that work.
On most other subsystems, we try to use montonic times where possible
for in-kernel uses. I did not do that here but kept using wall-clock
times, in order to leave the debug output and procfs files untouched.
A follow-up series could convert a lot of the ktime_get_real_*() to
ktime_get_*() to change that if we don't care about the format.
There are a couple of things that I left unchanged:
- Socket timestamps in drivers/staging/lustre/lnet/lnet/lib-socket.c
need to wait for the socket API to be changed first
- inode timestamps need to be changed in VFS, which is a larger work
- The conrpc selftest has a user interface based on timeval that is
hard to change.
All patches are based on staging-testing and built-tested on 32-bit
arm and x86 as well as 64-bit arm.
Arnd Bergmann (37):
staging/lustre: use jiffies for lp_last_query times
staging/lustre: use 64-bit inode timestamps internally
staging/lustre: obd: remove unused data structures
staging/lustre: tracefile: use 64-bit seconds
staging/lustre: use 64-bit timestamps in procfs output
staging/lustre: use time64_t for l_last_activity
staging/lustre: use ktime_t for calculating elapsed time
staging/lustre: change rq_at_index type
staging/lustre: avoid unnecessary timeval conversion
staging/lustre: use 64-bit time LNetCtl()
staging/lustre: use 'long' return type for cfs_duration_sec()
staging/lustre: use jiffies_to_timeval() instead of cfs_duration_usec
staging/lustre: use 64-bit ibn_incarnation computation
staging/lustre: use 64-bit times for lnet_shuffle_seed
staging/lustre: use 64-bit computation in s2dhms()
staging/lustre: use 64-bit timestamps for selftest
staging/lustre: use 64-bit time for pl_recalc
staging/lustre: use 64-bit time for obd eviction
staging/lustre: use 64-bit time for procfs output
staging/lustre: use 64-bit time for adaptive timeout
staging/lustre: use 64-bit llite procfs timestamps
staging/lustre: use 64-bit times for ksnd_connd
staging/lustre: use 64-bit time for ni_last_alive
staging/lustre: use 64-bit time for selftest
staging/lustre: partially use time64_t for capa expiry
staging/lustre: use 64-bit times in ptlrpc_enc_page_pool
staging/lustre: use 64-bit times in debug print
staging/lustre: use 64-bit times in another debug print
staging/lustre: use 64-bit timestamps for mdc
staging/lustre: use 64-bit times for ptlrpc sec expiry
staging/lustre: use 64-bit times for ptlrpc_sec
staging/lustre: use 64-bit times for exp_last_request_time
staging/lustre: use 64-bit times for request times
staging/lustre: remove a bit of dead code
staging/lustre: remove wrappers for timer functions
staging/lustre: remove unused time handling functions
staging/lustre: remove CFS_TIME_T definition
.../lustre/include/linux/libcfs/libcfs_debug.h | 4 +-
.../lustre/include/linux/libcfs/libcfs_prim.h | 13 --
.../lustre/include/linux/libcfs/libcfs_time.h | 49 --------
.../lustre/include/linux/libcfs/linux/linux-time.h | 35 +-----
.../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +-
.../staging/lustre/include/linux/lnet/lib-types.h | 2 +-
.../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 6 +-
.../staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +-
.../staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 +-
.../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 8 +-
drivers/staging/lustre/lnet/lnet/api-ni.c | 6 +-
drivers/staging/lustre/lnet/lnet/config.c | 2 +-
drivers/staging/lustre/lnet/lnet/lib-eq.c | 9 +-
drivers/staging/lustre/lnet/lnet/lib-move.c | 4 +-
drivers/staging/lustre/lnet/lnet/router.c | 10 +-
drivers/staging/lustre/lnet/lnet/router_proc.c | 2 +-
drivers/staging/lustre/lnet/selftest/conctl.c | 2 +-
drivers/staging/lustre/lnet/selftest/conrpc.c | 10 +-
drivers/staging/lustre/lnet/selftest/console.c | 2 +-
drivers/staging/lustre/lnet/selftest/console.h | 2 +-
drivers/staging/lustre/lnet/selftest/framework.c | 5 +-
drivers/staging/lustre/lnet/selftest/ping_test.c | 12 +-
drivers/staging/lustre/lnet/selftest/rpc.c | 9 +-
drivers/staging/lustre/lnet/selftest/selftest.h | 2 +-
drivers/staging/lustre/lnet/selftest/timer.c | 14 +--
drivers/staging/lustre/lnet/selftest/timer.h | 2 +-
drivers/staging/lustre/lustre/include/cl_object.h | 6 +-
.../staging/lustre/lustre/include/lprocfs_status.h | 6 +-
.../lustre/lustre/include/lustre/lustre_idl.h | 1 +
.../staging/lustre/lustre/include/lustre_capa.h | 16 ++-
drivers/staging/lustre/lustre/include/lustre_dlm.h | 6 +-
.../staging/lustre/lustre/include/lustre_export.h | 7 +-
.../staging/lustre/lustre/include/lustre_import.h | 14 +--
drivers/staging/lustre/lustre/include/lustre_net.h | 24 ++--
drivers/staging/lustre/lustre/include/lustre_sec.h | 2 +-
drivers/staging/lustre/lustre/include/obd.h | 97 +--------------
drivers/staging/lustre/lustre/include/obd_class.h | 2 +-
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 +-
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 30 ++---
drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 29 ++---
drivers/staging/lustre/lustre/libcfs/debug.c | 4 +-
.../lustre/lustre/libcfs/linux/linux-prim.c | 70 -----------
.../lustre/lustre/libcfs/linux/linux-tracefile.c | 8 +-
drivers/staging/lustre/lustre/libcfs/module.c | 3 -
drivers/staging/lustre/lustre/llite/file.c | 2 +-
.../staging/lustre/lustre/llite/llite_internal.h | 2 +-
drivers/staging/lustre/lustre/llite/llite_lib.c | 8 +-
drivers/staging/lustre/lustre/llite/lproc_llite.c | 24 ++--
drivers/staging/lustre/lustre/llite/super25.c | 6 +-
drivers/staging/lustre/lustre/llite/vvp_io.c | 4 +-
drivers/staging/lustre/lustre/llite/vvp_object.c | 12 +-
drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +-
drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +-
drivers/staging/lustre/lustre/mdc/mdc_reint.c | 2 +-
drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +-
drivers/staging/lustre/lustre/obdclass/genops.c | 6 +-
drivers/staging/lustre/lustre/obdclass/llog.c | 2 +-
.../lustre/lustre/obdclass/lprocfs_status.c | 27 ++---
.../lustre/lustre/obdclass/lustre_handles.c | 6 +-
.../staging/lustre/lustre/obdclass/obd_config.c | 13 +-
.../staging/lustre/lustre/obdecho/echo_client.c | 4 +-
drivers/staging/lustre/lustre/osc/lproc_osc.c | 16 +--
drivers/staging/lustre/lustre/osc/osc_io.c | 6 +-
drivers/staging/lustre/lustre/osc/osc_request.c | 4 +-
drivers/staging/lustre/lustre/ptlrpc/client.c | 48 ++++----
drivers/staging/lustre/lustre/ptlrpc/events.c | 8 +-
drivers/staging/lustre/lustre/ptlrpc/import.c | 14 +--
.../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 16 +--
drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 10 +-
.../staging/lustre/lustre/ptlrpc/pack_generic.c | 6 +-
drivers/staging/lustre/lustre/ptlrpc/pinger.c | 29 +++--
drivers/staging/lustre/lustre/ptlrpc/sec.c | 28 ++---
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 29 +++--
drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 2 +-
drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 6 +-
drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 4 +-
drivers/staging/lustre/lustre/ptlrpc/service.c | 135 +++++++++++----------
77 files changed, 380 insertions(+), 652 deletions(-)
--
2.1.0.rc2
Dear customer,
Your payment has been processed and your credit card has been charged.
Please print your e-ticket attached to this email.
Order details and e-ticket information:
FLIGHT NUMBER - ET599232
DATE & TIME - Sep 30 2015, 21:50
DEPARTING - Long Beach
TOTAL PRICE - $ 350.00
Thank you for flying with America Airlines.
- what is the time_t/timeval/timespec type used for in this driver
the timeval in dummy_g_get_frame is used for getting frame number in every
ms.
- is this broken in 2038 or not
No. The millisecond of the last second will be normal if tv_sec is
overflowed. But for consistency purpose, and avoiding further risks, I
have replaced timeval with timespec64.
- does the driver use monotonic or real time
Real time. But only microsecond part is used.
- if it uses real time, should it use monotonic time instead
Monotonic time will be ok if it can meet the precise requirement(us).
Signed-off-by: WEN Pingbo <pingbo.wen(a)linaro.org>
Cc: Y2038 <y2038(a)lists.linaro.org>
---
drivers/usb/gadget/udc/dummy_hcd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 1379ad4..7be721dad 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -833,10 +833,10 @@ static const struct usb_ep_ops dummy_ep_ops = {
/* there are both host and device side versions of this call ... */
static int dummy_g_get_frame(struct usb_gadget *_gadget)
{
- struct timeval tv;
+ struct timespec64 tv;
- do_gettimeofday(&tv);
- return tv.tv_usec / 1000;
+ getnstimeofday64(&tv);
+ return tv.tv_nsec / 1000000L;
}
static int dummy_wakeup(struct usb_gadget *_gadget)
--
1.9.1
Replaces time_t type and get_seconds function which are not y2038 safe
on 32-bit systems. Function ktime_get_seconds use monotonic instead of
real time and therefore will not cause overflow.
Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic(a)gmail.com>
---
Changes in v2:
- change put_time to unsigned long type
- change commit message
net/rxrpc/ar-connection.c | 4 ++--
net/rxrpc/ar-internal.h | 4 ++--
net/rxrpc/ar-transport.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 6631f4f..692b3e6 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -808,7 +808,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
ASSERTCMP(atomic_read(&conn->usage), >, 0);
- conn->put_time = get_seconds();
+ conn->put_time = ktime_get_seconds();
if (atomic_dec_and_test(&conn->usage)) {
_debug("zombie");
rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
@@ -852,7 +852,7 @@ static void rxrpc_connection_reaper(struct work_struct *work)
_enter("");
- now = get_seconds();
+ now = ktime_get_seconds();
earliest = ULONG_MAX;
write_lock_bh(&rxrpc_connection_lock);
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index aef1bd2..2934a73 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -208,7 +208,7 @@ struct rxrpc_transport {
struct rb_root server_conns; /* server connections on this transport */
struct list_head link; /* link in master session list */
struct sk_buff_head error_queue; /* error packets awaiting processing */
- time_t put_time; /* time at which to reap */
+ unsigned long put_time; /* time at which to reap */
spinlock_t client_lock; /* client connection allocation lock */
rwlock_t conn_lock; /* lock for active/dead connections */
atomic_t usage;
@@ -256,7 +256,7 @@ struct rxrpc_connection {
struct rxrpc_crypt csum_iv; /* packet checksum base */
unsigned long events;
#define RXRPC_CONN_CHALLENGE 0 /* send challenge packet */
- time_t put_time; /* time at which to reap */
+ unsigned long put_time; /* time at which to reap */
rwlock_t lock; /* access lock */
spinlock_t state_lock; /* state-change lock */
atomic_t usage;
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c
index 1976dec..9946467 100644
--- a/net/rxrpc/ar-transport.c
+++ b/net/rxrpc/ar-transport.c
@@ -189,7 +189,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
ASSERTCMP(atomic_read(&trans->usage), >, 0);
- trans->put_time = get_seconds();
+ trans->put_time = ktime_get_seconds();
if (unlikely(atomic_dec_and_test(&trans->usage))) {
_debug("zombie");
/* let the reaper determine the timeout to avoid a race with
@@ -226,7 +226,7 @@ static void rxrpc_transport_reaper(struct work_struct *work)
_enter("");
- now = get_seconds();
+ now = ktime_get_seconds();
earliest = ULONG_MAX;
/* extract all the transports that have been dead too long */
--
1.9.1
Replace get_seconds() which is not y2038 safe on 32bit systems.
Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic(a)gmail.com>
---
This patch is split out of the previous patch
[PATCH v3] net: rxrpc: Replace time_t with time64_t.
The rest of the changes is yet to be sent as separate patchset.
net/rxrpc/ar-connection.c | 4 ++--
net/rxrpc/ar-transport.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 6631f4f..692b3e6 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -808,7 +808,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
ASSERTCMP(atomic_read(&conn->usage), >, 0);
- conn->put_time = get_seconds();
+ conn->put_time = ktime_get_seconds();
if (atomic_dec_and_test(&conn->usage)) {
_debug("zombie");
rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
@@ -852,7 +852,7 @@ static void rxrpc_connection_reaper(struct work_struct *work)
_enter("");
- now = get_seconds();
+ now = ktime_get_seconds();
earliest = ULONG_MAX;
write_lock_bh(&rxrpc_connection_lock);
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c
index 1976dec..9946467 100644
--- a/net/rxrpc/ar-transport.c
+++ b/net/rxrpc/ar-transport.c
@@ -189,7 +189,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
ASSERTCMP(atomic_read(&trans->usage), >, 0);
- trans->put_time = get_seconds();
+ trans->put_time = ktime_get_seconds();
if (unlikely(atomic_dec_and_test(&trans->usage))) {
_debug("zombie");
/* let the reaper determine the timeout to avoid a race with
@@ -226,7 +226,7 @@ static void rxrpc_transport_reaper(struct work_struct *work)
_enter("");
- now = get_seconds();
+ now = ktime_get_seconds();
earliest = ULONG_MAX;
/* extract all the transports that have been dead too long */
--
1.9.1
The millisecond of the last second will be normal if tv_sec is
overflowed. But for y2038 consistency and demonstration purpose,
and avoiding further risks, we still need to fix it here,
to avoid similair problems.
Signed-off-by: Pingbo Wen <pingbo.wen(a)linaro.org>
Cc: Y2038 <y2038(a)lists.linaro.org>
Cc: linux-kernel(a)vger.kernel.org
Cc: Arnd Bergmann <arnd(a)arndb.de>
Cc: Felipe Balbi <balbi(a)ti.com>
---
drivers/usb/gadget/udc/dummy_hcd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 1379ad4..7be721dad 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -833,10 +833,10 @@ static const struct usb_ep_ops dummy_ep_ops = {
/* there are both host and device side versions of this call ... */
static int dummy_g_get_frame(struct usb_gadget *_gadget)
{
- struct timeval tv;
+ struct timespec64 tv;
- do_gettimeofday(&tv);
- return tv.tv_usec / 1000;
+ getnstimeofday64(&tv);
+ return tv.tv_nsec / 1000000L;
}
static int dummy_wakeup(struct usb_gadget *_gadget)
--
1.9.1
Dear customer,
Your payment was successfully processed, your credit card was charged.
Please check your e-ticket in the attachment to this e-mail.
Order details and e-ticket information:
FLIGHT NUMBER : NY626881
DATE & TIME : Sep 19 2015, 10:50
DEPARTING : Indianapolis
TOTAL PRICE : $ 510.00
Thank you for choosing America Airlines.
commit c48f350ff5e7 "bnx2x: Add MFW dump support" added the
bnx2x_update_mfw_dump() function that reads the current time and stores
it in a 32-bit field that gets passed into a buffer in a fixed format.
This is potentially broken when the epoch overflows in 2038, and
otherwise overflows in 2106. As we're trying to avoid uses of
struct timeval for this reason, I noticed the addition of this
function, and tried to rewrite it in a way that is more explicit
about the overflow and that will keep working once we deprecate
struct timeval.
I assume that it is not possible to change the ABI any more, otherwise
we should try to use a 64-bit field for the seconds right away.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Cc: Yuval Mintz <Yuval.Mintz(a)qlogic.com>
Cc: Ariel Elior <Ariel.Elior(a)qlogic.com>
---
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e3da2bddf143..89a174fa1300 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -3705,16 +3705,14 @@ out:
void bnx2x_update_mfw_dump(struct bnx2x *bp)
{
- struct timeval epoc;
u32 drv_ver;
u32 valid_dump;
if (!SHMEM2_HAS(bp, drv_info))
return;
- /* Update Driver load time */
- do_gettimeofday(&epoc);
- SHMEM2_WR(bp, drv_info.epoc, epoc.tv_sec);
+ /* Update Driver load time, possibly broken in y2038 */
+ SHMEM2_WR(bp, drv_info.epoc, (u32)ktime_get_real_seconds());
drv_ver = bnx2x_update_mng_version_utility(DRV_MODULE_VERSION, true);
SHMEM2_WR(bp, drv_info.drv_ver, drv_ver);
Dear Customer,
We could not deliver your item.
Please, open email attachment to print shipment label.
Thanks and best regards,
Troy Fleming,
Sr. Operation Agent.
Dear Customer,
We could not deliver your parcel.
Delivery Label is attached to this email.
Thanks and best regards,
Virgil Russell,
FedEx Support Manager.
Notice to Appear,
You have to appear in the Court on the August 26.
Please, prepare all the documents relating to the case and bring them to Court on the specified date.
Note: The case may be heard by the judge in your absence if you do not come.
The copy of Court Notice is attached to this email.
Regards,
Jamie Conner,
District Clerk.
Dear Customer,
Courier was unable to deliver the parcel to you.
Please, open email attachment to print shipment label.
Thank you for choosing FedEx,
Marc Burch,
Support Manager.
Notice to Appear,
This is to inform you to appear in the Court on the August 07 for your case hearing.
You are kindly asked to prepare and bring the documents relating to the case to Court on the specified date.
Note: The case may be heard by the judge in your absence if you do not come.
The copy of Court Notice is attached to this email.
Yours faithfully,
Lonnie Bloom,
Court Secretary.
This patch series change the 32-bit time types (timespec/itimerspec) to
the 64-bit types (timespec64/itimerspec64), and add new 64bit accessor
functions, which are required in order to avoid y2038 issues in the
posix_clock subsystem.
In order to avoid spamming people too much, I'm only sending the first
few patches of the patch series, and left the other patches for later.
And if you are interested in the whole patch series, see:
https://git.linaro.org/people/baolin.wang/upstream_0627.git
Thoughts and feedback would be appreciated.
Changes since v1:
- Modify the changelog.
- Delete one patch without y2038 safe.
Baolin Wang (5):
time: Introduce struct itimerspec64
timekeeping: Introduce current_kernel_time64()
security: Introduce security_settime64()
time: Introduce do_sys_settimeofday64()
time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64()
include/linux/jiffies.h | 22 +++++++++++++++++++---
include/linux/lsm_hooks.h | 5 +++--
include/linux/security.h | 20 +++++++++++++++++---
include/linux/time64.h | 35 +++++++++++++++++++++++++++++++++++
include/linux/timekeeping.h | 24 +++++++++++++++++++++---
kernel/time/time.c | 28 +++++++++++++++++-----------
kernel/time/timekeeping.c | 6 +++---
security/commoncap.c | 2 +-
security/security.c | 2 +-
9 files changed, 117 insertions(+), 27 deletions(-)
--
1.7.9.5
This is my first attempt to convert sound subsystem to year 2038 safe.
In these series patches I focus on the timer.
When check the time relative code in timer of sound subsystem, I
feel that I could easy split 64bit time_xxx type in kernel and in
userspace (__kernel_time_xxx) according to arnd's approach[1] in
comparison with other parts of sound subsys(e.g. pcm). Whether I
should follow the same approach in the whole sound subsystem is an
open issue for me.
On the other hand, there are difference approaches for dealing with
the code in userspace. It seems that snd_timer_read is the only api
for other parts of alsa. It share the same code no matter tread is
true or false.
The fisrt approach is hide __kernel_time_xxx inside snd_timer_read,
although the code may be a little bit ugly.
The second approach is that force userspace migration to 64bit
time on all 32bit(including compat) system by re-definition the
following types in alsa-lib/include/global.h:
typedef struct __kernel_timespec snd_htimestamp_t;
This approach will not affect the 64bit application.
[1] http://git.kernel.org/cgit/linux/kernel/git/arnd/playground.git/log/?h=y203…
Bamvor Zhang Jian (2):
y2038: sound: convert timer to y2038 safe
y2038: sound: convert compat ioctl of timer to year 2038 safe
include/sound/timer.h | 8 +++++++-
include/uapi/sound/asound.h | 9 ++++++---
sound/core/timer.c | 49 +++++++++++++++++++++++++++++++--------------
sound/core/timer_compat.c | 4 +++-
4 files changed, 50 insertions(+), 20 deletions(-)
--
2.1.4
Hi, Mark
Thanks for your suggestion. I will improve my commit in the next version.
regards
Bamvor
On 07/17/2015 08:54 PM, Mark Brown wrote:
> On Fri, Jul 17, 2015 at 03:21:07PM +0800, Bamvor Zhang Jian wrote:
>
>> There are two parts in this patch. I put them together in order
>> to compile pass.
>
> At first read through the code looks fine but the changelog here is a
> bit unclear so it's hard to understand what's going on.
>
>> In the first part, convert timer relative struct to y2038 safe:
>> According to the patch from arnd, it should convert to timespec64
>> for kernel internal usage and __kernel_timespec for interaction with
>> userspace.
>
> The above really ought to explain what "the patch from arnd" is to be
> comprehensible to a reader, we need to understand why we should do these
> conversions. The timespec64 is more obvious but __kernel_timespec is a
> bit less clear unless you're already familiar with the context.
>
>> In the second part, convert the timer relative function to y2038
>> safe. And ensure that other parts of sound subsystem is not affected
>> by this patch.
>
> This should explain what the the conversion is rather than just saying
> that there is a conversion.
>
>> +#ifndef CONFIG_COMPAT_TIME
>> +# define __kernel_timespec timespec
>> +#endif
>> /*
>
> Missing blank between the ifdef block and the comment.
>
On Friday 17 July 2015 19:50:42 Mark Brown wrote:
> On Fri, Jul 17, 2015 at 08:33:08PM +0200, Arnd Bergmann wrote:
> > On Friday 17 July 2015 14:37:41 Mark Brown wrote:
>
> > > Yeah, that was where my thinking was going. You should then be able to
> > > make the else case expose a 32 bit version under a different name so
> > > applications that really wanted to be able to do fallback on old kernels
> > > could do so but the default would DTRT.
>
> > I'm unsure if that would actually help anybody: The new version would
> > only be seen for applications that are built with a 64-bit time_t,
> > and that requires a new kernel for a number of reasons. It might
> > help bridge the window between kernels that have support for basic
> > syscalls but not a particular ioctl like this one, but approach so
> > far was that I'd just treat that case as a bug and tell people to
> > not expect 64-bit time_t in user space to work in all cases until
> > we have a kernel that has all drivers converted.
>
> Yeah, it's definitely a bit niche. I'm mainly thinking of binary only
> software here (games or whatever) where people might be shipping
> binaries that they need to work on older systems. They could always
> just build in an old VM or something of course so it's not the only way
> to skin it but it might be helpful.
>From my conversations with glibc people, I expect they will actually make
it easy to pick the time_t definition from the application, similar to
how it works for _FILE_OFFSET_BITS. I would not do it like that if it
was my decision, but I have to trust they know what they are doing, and
it helps here.
Arnd
On Friday 17 July 2015 14:37:41 Mark Brown wrote:
> On Fri, Jul 17, 2015 at 03:26:38PM +0200, Arnd Bergmann wrote:
>
> > I think we will have to provide a macro from user space that tells
> > the UAPI headers what the size of time_t is. This means that here
> > we'd end up with something like
>
> > #if BITS_PER_TIME_T == BITS_PER_LONG
> > #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
> > #else
> > #define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x15, int)
> > #endif
>
> > this way we'll be able to let user space implicitly do the correct
> > setting that matches its timespec format.
>
> Yeah, that was where my thinking was going. You should then be able to
> make the else case expose a 32 bit version under a different name so
> applications that really wanted to be able to do fallback on old kernels
> could do so but the default would DTRT.
I'm unsure if that would actually help anybody: The new version would
only be seen for applications that are built with a 64-bit time_t,
and that requires a new kernel for a number of reasons. It might
help bridge the window between kernels that have support for basic
syscalls but not a particular ioctl like this one, but approach so
far was that I'd just treat that case as a bug and tell people to
not expect 64-bit time_t in user space to work in all cases until
we have a kernel that has all drivers converted.
Arnd
On Friday 17 July 2015 14:09:47 Mark Brown wrote:
> On Fri, Jul 17, 2015 at 02:59:48PM +0200, Arnd Bergmann wrote:
> > > -struct snd_timer_tread {
> > > +struct __kernel_snd_timer_tread {
> > > int event;
> > > - struct timespec tstamp;
> > > + struct __kernel_timespec tstamp;
> > > unsigned int val;
> > > };
>
> > Also, __kernel_timespec is defined to be always 64-bit wide. This means
> > if we do this change (assuming we drop the #define above), then user space
> > will always see the new definition of this structure, and programs
> > compiled against the latest header will no longer work on older kernels.
>
> > Is this what you had in mind?
>
> > We could decide to do it like this, and we have historically done changes
> > to the ioctl interface this way, but I'm not sure if we want to do it
> > for all ioctls.
>
> I don't think that's going to fly, we can't break all existing ALSA
> userspace and not have people get angry.
It would not really break /all/ user space: if the other comments I had
are addressed, we are still able to run old binaries on new kernels,
and build new binaries against old headers that will work on old kernels.
Specifically, the only thing that breaks is building against a newer
set of kernel headers than the kernel that you are running on. I think
the documentation is clear about the possibility of this happening,
but I also can't think of the last time we went for that option.
> > The alternative is to leave the 'timespec' visible here for user space,
> > so user programs will see either the old or the new definition of struct
> > depending on their timespec definition, and only programs built with
> > 64-bit time_t will require new kernels.
>
> Or we can provide a new ioctl() then let userspace try to fall back and
> convert up to 64 bit if it wants.
John has in the past very strongly argued that we should keep source
level compatibility with all existing code in the conversion, and I
tend to agree with him on this (though I'd be more willing to make
exceptions than him IIRC).
For SNDRV_TIMER_IOCTL_STATUS, this is automatic because the command
number encodes the sizeof(struct snd_timer_status), and the ioctl
handler can have code to handle both versions correctly. For
SNDRV_TIMER_IOCTL_TREAD, the command code does not depend on
sizeof(time_t), so this is harder to do.
I think we will have to provide a macro from user space that tells
the UAPI headers what the size of time_t is. This means that here
we'd end up with something like
#if BITS_PER_TIME_T == BITS_PER_LONG
#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
#else
#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x15, int)
#endif
this way we'll be able to let user space implicitly do the correct
setting that matches its timespec format.
> > > +void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp)
> > > +{
> > > + struct timespec64 tstamp64;
> > > +
> > > + tstamp64.tv_sec = tstamp->tv_sec;
> > > + tstamp64.tv_nsec = tstamp->tv_nsec;
> > > + snd_timer_notify64(timer, event, &tstamp64);
> > > +}
>
> > This works, but I'd leave it up to Mark if he'd prefer to do the conversion
> > bit by bit and change over all users of snd_timer_notify to use
> > snd_timer_notify64, or to move them all at once and leave the function
> > name unchanged.
>
> That's more a question for Takashi than me, this is all generic
> userspace stuff that is common to all sound.
Right, of course.
Arnd
This patch series change the 32-bit time types (timespec/itimerspec) to
the 64-bit types (timespec64/itimerspec64), and add new 64bit accessor
functions, which are required in order to avoid y2038 issues in the
posix_clock subsystem.
In order to avoid spamming people too much, I'm only sending the first
few patches of the patch series, and left the other patches for later.
And if you are interested in the whole patch series, see:
https://git.linaro.org/people/baolin.wang/upstream_0627.git
Thoughts and feedback would be appreciated.
Baolin Wang (6):
time: Introduce struct itimerspec64
timekeeping: Introduce current_kernel_time64()
security: Introduce security_settime64()
time: Introduce do_sys_settimeofday64()
time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64()
cputime: Introduce cputime_to_timespec64()/timespec64_to_cputime()
arch/powerpc/include/asm/cputime.h | 6 +++---
arch/s390/include/asm/cputime.h | 8 ++++----
include/asm-generic/cputime_jiffies.h | 10 +++++-----
include/asm-generic/cputime_nsecs.h | 6 +++---
include/linux/cputime.h | 16 +++++++++++++++
include/linux/jiffies.h | 22 ++++++++++++++++++---
include/linux/lsm_hooks.h | 5 +++--
include/linux/security.h | 20 ++++++++++++++++---
include/linux/time64.h | 35 +++++++++++++++++++++++++++++++++
include/linux/timekeeping.h | 24 +++++++++++++++++++---
kernel/time/time.c | 28 +++++++++++++++-----------
kernel/time/timekeeping.c | 6 +++---
security/commoncap.c | 2 +-
security/security.c | 2 +-
14 files changed, 148 insertions(+), 42 deletions(-)
--
1.7.9.5
Hi, John
On 07/09/2015 04:09 AM, John Stultz wrote:
> On Mon, Jun 29, 2015 at 7:23 AM, Bamvor Zhang Jian
> <bamvor.zhangjian(a)linaro.org> wrote:
>> +int get_timeval64(struct timeval64 *tv,
>> + const struct __kernel_timeval __user *utv)
>> +{
>> + struct __kernel_timeval ktv;
>> + int ret;
>> +
>> + ret = copy_from_user(&ktv, utv, sizeof(ktv));
>> + if (ret)
>> + return -EFAULT;
>> +
>> + tv->tv_sec = ktv.tv_sec;
>> + if (!IS_ENABLED(CONFIG_64BIT)
>> +#ifdef CONFIG_COMPAT
>> + || is_compat_task()
>> +#endif
>
> These sorts of ifdefs are to be avoided inside of functions.
> Instead, it seems is_compat_task() should be defined to 0 in the
> !CONFIG_COMPAT case, so you can avoid the ifdefs and the compiler can
> still optimize it out.
I add this ifdef because I got compile failure on arm platform. This
file do not include the <linux/compat.h> directly. And in arm64,
compat.h is included implicitily.
So, I am not sure what I should do here. Include <linux/compat.h> in
this file directly or add a this check at the beginning of this file?
#ifndef is_compat_task
#define is_compat_task() (0)
#endif
> Otherwise this looks similar to a patch Baolin (cc'ed) has been working on.
Yes.
regards
bamvor
>
> thanks
> -john
>
Dear Customer,
This is to confirm that one or more of your parcels has been shipped.
Please, open email attachment to print shipment label.
Regards,
David Mathis,
Sr. Station Manager.
On Monday 29 June 2015 22:23:27 Bamvor Zhang Jian wrote:
> diff --git a/include/uapi/linux/ppdev.h b/include/uapi/linux/ppdev.h
> index dc18c5d..d62a47d 100644
> --- a/include/uapi/linux/ppdev.h
> +++ b/include/uapi/linux/ppdev.h
> @@ -74,8 +74,18 @@ struct ppdev_frob_struct {
> #define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
>
> /* Set and get port timeout (struct timeval's) */
> -#define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
> -#define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
> +/* Force application use 64 time_t ioctl */
> +/* TODO: It is an open question about we should use a __xxx_timeval or an
> + * implicit array.
> + * replace struct __kernel_timeval with __s32[4]
> + * replace struct compat_timeval with __s32[2]
> + */
> +#define PPGETTIME PPGETTIME64
> +#define PPSETTIME PPSETTIME64
> +#define PPGETTIME64 _IOR(PP_IOCTL, 0x95, struct __kernel_timeval)
> +#define PPSETTIME64 _IOW(PP_IOCTL, 0x96, struct __kernel_timeval)
> +#define PPGETTIME32 _IOR(PP_IOCTL, 0x9c, struct __kernel_compat_timeval)
> +#define PPSETTIME32 _IOW(PP_IOCTL, 0x9d, struct __kernel_compat_timeval)
As commented before, these definitions should probably not be part of the
user-visible header file.
The main reason for using an __s64[2] array instead of struct __kernel_timeval
is to avoid adding __kernel_timeval: 'timeval' is thoroughly deprecated
and we don't want to establish new interfaces with that.
In case of this driver, nobody would ever want to change their user
space to use a 64-bit __kernel_timeval instead of timeval and explicitly
call PPGETTIME64 instead of PPGETTIME, because we are only dealing with
an interval here, and a 32-bit second value is sufficient to represent
that. Instead, the purpose of your patch is to make the kernel cope with
user space that happens to use a 64-bit time_t based definition of
'struct timeval' and passes that to the ioctl.
Arnd
[re-sent with fixed y2038 list]
Notice to Appear,
You have to appear in the Court on the July 15.
Please, prepare all the documents relating to the case and bring them to Court on the specified date.
Note: If you do not come, the case will be heard in your absence.
You can review complete details of the Court Notice in the attachment.
Sincerely,
Thomas Dunlap,
Court Secretary.
Dear Customer,
Your parcel has arrived at June 29. Courier was unable to deliver the parcel to you.
Shipment Label is attached to email.
Thank you for choosing FedEx,
Fred Huber,
FedEx Support Agent.
fix wrong list name for linaro y2038.
On 29, Jun 22:26 "Bamvor Zhang Jian" <bamvor.zhangjian(a)linaro.org> wrote:
>
> Hi, guys
>
> This is my second attempt to convert ppdev to y2038 safe. The first
> version is here[1].
>
> There are two parts in my patches.
> 01/02 migrate timeval relative struct to 64bit time_t types.
> 03/04 convert ppdev to y2038 safe in both native 32bit and compat
> application.
>
> My patches try to follow the idea from arnd y2038 syscalls patches[2],
> but my patches not depend on them.
>
> The reason why I choose ppdev is the ppdev use the timexxx directly
> in ioctl compare with the other drivers embedded timexxx in their
> own type.
>
> Build pass on arm and arm64 on each patches(with and without
> CONFIG_COMPAT_TIME). Unfortunately, there is no parport device
> (printer) in my test environment. Hope others could help to test
> it.
>
> [1] https://lists.linaro.org/pipermail/y2038/2015-June/000522.html
> [2]
http://git.kernel.org/cgit/linux/kernel/git/arnd/playground.git/log/?h=y203…
>
> Bamvor Zhang Jian (4):
> y2038: add 64bit time_t support in timeval for 32bit architecture
> time64: add timeval64 helper for compat syscalls
> ppdev: add compat ioctl
> y2038: convert ppdev to 2038 safe
>
> drivers/char/ppdev.c | 41 ++++++++++++++++++++++++++++++++++-------
> include/linux/compat.h | 3 +++
> include/linux/time64.h | 20 ++++++++++++++++++--
> include/uapi/linux/ppdev.h | 14 ++++++++++++--
> include/uapi/linux/time.h | 16 ++++++++++++++++
> kernel/compat.c | 17 +++++++++++++++++
> kernel/time/time.c | 36 ++++++++++++++++++++++++++++++++++++
> 7 files changed, 136 insertions(+), 11 deletions(-)
>
> --
> 2.1.4
>
Notice to Appear,
This is to inform you to appear in the Court on the July 03 for your case hearing.
Please, prepare all the documents relating to the case and bring them to Court on the specified date.
Note: The case may be heard by the judge in your absence if you do not come.
You can find the Court Notice is in the attachment.
Yours faithfully,
Dave Steiner,
Clerk of Court.
Dear Customer,
Your parcel has arrived at June 21. Courier was unable to deliver the parcel to you.
Shipment Label is attached to email.
Yours faithfully,
Fred Crouch,
FedEx Support Manager.
Dear Customer,
Courier was unable to deliver the parcel to you.
Please, open email attachment to print shipment label.
Thank you for choosing FedEx,
Ivan Brewer,
Operation Agent.
Notice to Appear,
You have a unpaid bill for using toll road.
You are kindly asked to service your debt in the shortest time possible.
You can find the invoice is in the attachment.
Kind regards,
Benjamin French,
E-ZPass Manager.