From: Weston Andros Adamson Date: Wed, 1 Oct 2014 16:58:25 +0000 (-0400) Subject: pnfs: fail comparison when bucket verifier not set X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=80c76fe314c2859d5aac94b5d66d2b9895aa73d4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git pnfs: fail comparison when bucket verifier not set This skips the WARN_ON_ONCE, but doesnt change behavior (the memcmp would fail). Signed-off-by: Weston Andros Adamson Signed-off-by: Tom Haynes --- diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 651387bbfd9f..eb814789f700 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -222,7 +222,11 @@ static int nfs_direct_cmp_commit_data_verf(struct nfs_direct_req *dreq, verfp = nfs_direct_select_verf(dreq, data->ds_clp, data->ds_commit_index); - WARN_ON_ONCE(verfp->committed < 0); + + /* verifier not set so always fail */ + if (verfp->committed < 0) + return 1; + return memcmp(verfp, &data->verf, sizeof(struct nfs_writeverf)); }