1. 30 Jul, 2022 2 commits
    • Chuck Lever's avatar
      SUNRPC: Fix xdr_encode_bool() · c770f31d
      Chuck Lever authored
      I discovered that xdr_encode_bool() was returning the same address
      that was passed in the @p parameter. The documenting comment states
      that the intent is to return the address of the next buffer
      location, just like the other "xdr_encode_*" helpers.
      
      The result was the encoded results of NFSv3 PATHCONF operations were
      not formed correctly.
      
      Fixes: ded04a58 ("NFSD: Update the NFSv3 PATHCONF3res encoder to use struct xdr_stream")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      c770f31d
    • Jeff Layton's avatar
      nfsd: eliminate the NFSD_FILE_BREAK_* flags · 23ba98de
      Jeff Layton authored
      We had a report from the spring Bake-a-thon of data corruption in some
      nfstest_interop tests. Looking at the traces showed the NFS server
      allowing a v3 WRITE to proceed while a read delegation was still
      outstanding.
      
      Currently, we only set NFSD_FILE_BREAK_* flags if
      NFSD_MAY_NOT_BREAK_LEASE was set when we call nfsd_file_alloc.
      NFSD_MAY_NOT_BREAK_LEASE was intended to be set when finding files for
      COMMIT ops, where we need a writeable filehandle but don't need to
      break read leases.
      
      It doesn't make any sense to consult that flag when allocating a file
      since the file may be used on subsequent calls where we do want to break
      the lease (and the usage of it here seems to be reverse from what it
      should be anyway).
      
      Also, after calling nfsd_open_break_lease, we don't want to clear the
      BREAK_* bits. A lease could end up being set on it later (more than
      once) and we need to be able to break those leases as well.
      
      This means that the NFSD_FILE_BREAK_* flags now just mirror
      NFSD_MAY_{READ,WRITE} flags, so there's no need for them at all. Just
      drop those flags and unconditionally call nfsd_open_break_lease every
      time.
      Reported-by: default avatarOlga Kornieskaia <kolga@netapp.com>
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=2107360
      Fixes: 65294c1f (nfsd: add a new struct file caching facility to nfsd)
      Cc: <stable@vger.kernel.org> # 5.4.x : bb283ca1 NFSD: Clean up the show_nf_flags() macro
      Cc: <stable@vger.kernel.org> # 5.4.x
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      23ba98de
  2. 17 Jul, 2022 15 commits
  3. 16 Jul, 2022 12 commits
  4. 15 Jul, 2022 11 commits