X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=fs%2Fnfsd%2Fnfs4callback.c;h=c3b11a715082914c2bfee7be0d27a507be967fdd;hb=6c8beff74c6aafa60cb69b44139de58b74a775e7;hp=24534db87e8606ee9bb72520f4590d0bf462970d;hpb=62af608b4b075871f7214c345c42a2e7a456f35d;p=linux-2.6-microblaze.git diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 24534db87e86..c3b11a715082 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -823,7 +823,16 @@ static const struct rpc_program cb_program = { static int max_cb_time(struct net *net) { struct nfsd_net *nn = net_generic(net, nfsd_net_id); - return max(nn->nfsd4_lease/10, (time_t)1) * HZ; + + /* + * nfsd4_lease is set to at most one hour in __nfsd4_write_time, + * so we can use 32-bit math on it. Warn if that assumption + * ever stops being true. + */ + if (WARN_ON_ONCE(nn->nfsd4_lease > 3600)) + return 360 * HZ; + + return max(((u32)nn->nfsd4_lease)/10, 1u) * HZ; } static struct workqueue_struct *callback_wq;