20 Jan, 2021
2 commits
-
commit 46c9ea1d4fee4cf1f8cc6001b9c14aae61b3d502 upstream.
We must ensure that we pass a layout segment to nfs_retry_commit() when
we're cleaning up after pnfs_bucket_alloc_ds_commits(). Otherwise,
requests that should be committed to the DS will get committed to the
MDS.
Do so by ensuring that pnfs_bucket_get_committing() always tries to
return a layout segment when it returns a non-empty page list.Fixes: c84bea59449a ("NFS/pNFS: Simplify bucket layout segment reference counting")
Signed-off-by: Trond Myklebust
Signed-off-by: Greg Kroah-Hartman -
commit 1757655d780d9d29bc4b60e708342e94924f7ef3 upstream.
In pnfs_generic_clear_request_commit(), we try calling
pnfs_free_bucket_lseg() before we remove the request from the DS bucket.
That will always fail, since the point is to test for whether or not
that bucket is empty.Fixes: c84bea59449a ("NFS/pNFS: Simplify bucket layout segment reference counting")
Signed-off-by: Trond Myklebust
Signed-off-by: Greg Kroah-Hartman
13 May, 2020
1 commit
-
When we're doing pnfs then the credential being used for the RPC call
is not necessarily the same as the one used in the open context, so
don't use RPC_TASK_CRED_NOREF.Fixes: 612965072020 ("NFSv4: Avoid referencing the cred unnecessarily during NFSv4 I/O")
Signed-off-by: Trond Myklebust
11 Apr, 2020
1 commit
-
Another brown paper bag moment. pnfs_alloc_ds_commits_list() is leaking
the RCU lock.Fixes: a9901899b649 ("pNFS: Add infrastructure for cleaning up per-layout commit structures")
Signed-off-by: Trond Myklebust
28 Mar, 2020
10 commits
-
Fix up pnfs_layout_mark_request_commit() to alway reschedule the write
if the layout segment is invalid. Also minor cleanup.Signed-off-by: Trond Myklebust
-
Signed-off-by: Trond Myklebust
-
Move the pNFS commit related operations into a separate structure
that can be carried by the pnfs_ds_commit_info.Signed-off-by: Trond Myklebust
-
Remove the unused bucket array in struct pnfs_ds_commit_info.
Signed-off-by: Trond Myklebust
-
Lift filelayout_search_commit_reqs() into the generic pnfs/nfs code,
and add support for commit arrays.Signed-off-by: Trond Myklebust
-
Enable adding and lookup of per-layout segment commits in filelayout
and flexfilelayout.Signed-off-by: Trond Myklebust
-
Ensure that both the file and flexfiles layout types clean up when
freeing the layout segments.Signed-off-by: Trond Myklebust
-
Add support for scanning the full list of per-layout segment commit
arrays to pnfs_generic_commit_pagelist().Signed-off-by: Trond Myklebust
-
Add support for scanning the full list of per-layout segment commit
arrays to pnfs_generic_recover_commit_reqs().Signed-off-by: Trond Myklebust
-
Add support for scanning the full list of per-layout segment commit
arrays to pnfs_generic_scan_commit_lists()Signed-off-by: Trond Myklebust
26 Mar, 2020
2 commits
-
Signed-off-by: Trond Myklebust
-
Refactor pnfs_generic_commit_pagelist() to simplify the conversion
to layout segment based commit lists.Signed-off-by: Trond Myklebust
15 Jan, 2020
1 commit
-
Instead of making assumptions about the commit verifier contents, change
the commit code to ensure we always check that the verifier was set
by the XDR code.Fixes: f54bcf2ecee9 ("pnfs: Prepare for flexfiles by pulling out common code")
Signed-off-by: Trond Myklebust
Signed-off-by: Anna Schumaker
27 Aug, 2019
1 commit
-
The pNFS/flexfiles I/O requests are sent with the SOFTCONN flag set, so
they automatically time out if the connection breaks. It should
therefore not be necessary to have the soft flag set in addition.Fixes: 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
Signed-off-by: Trond Myklebust
21 May, 2019
1 commit
-
Add SPDX license identifiers to all files which:
- Have no license information of any form
- Have EXPORT_.*_SYMBOL_GPL inside which was used in the
initial scan/conversion to ignore the fileThese files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:GPL-2.0-only
Signed-off-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
20 Dec, 2018
1 commit
-
SUNRPC has two sorts of credentials, both of which appear as
"struct rpc_cred".
There are "generic credentials" which are supplied by clients
such as NFS and passed in 'struct rpc_message' to indicate
which user should be used to authorize the request, and there
are low-level credentials such as AUTH_NULL, AUTH_UNIX, AUTH_GSS
which describe the credential to be sent over the wires.This patch replaces all the generic credentials by 'struct cred'
pointers - the credential structure used throughout Linux.For machine credentials, there is a special 'struct cred *' pointer
which is statically allocated and recognized where needed as
having a special meaning. A look-up of a low-level cred will
map this to a machine credential.Signed-off-by: NeilBrown
Acked-by: J. Bruce Fields
Signed-off-by: Anna Schumaker
15 Aug, 2018
1 commit
-
The use of the inode->i_lock was converted to a mutex, but we forgot
to remove the old inode unlock/lock() pair that allowed the layout
segment to be put inside the loop.Reported-by: Jia-Ju Bai
Fixes: e824f99adaaf1 ("NFSv4: Use a mutex to protect the per-inode commit...")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Trond Myklebust
Signed-off-by: Anna Schumaker
20 Mar, 2018
1 commit
-
The old wait_on_atomic_t() is going to get removed, use the more
flexible wait_var_event() API instead.No change in functionality.
Signed-off-by: Peter Zijlstra (Intel)
Cc: Anna Schumaker
Cc: Linus Torvalds
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar
18 Nov, 2017
1 commit
-
atomic_t variables are currently used to implement reference
counters with the following properties:
- counter is initialized to 1 using atomic_set()
- a resource is freed upon counter reaching zero
- once counter reaches zero, its further
increments aren't allowed
- counter schema uses basic atomic operations
(set, inc, inc_not_zero, dec_and_test, etc.)Such atomic variables should be converted to a newly provided
refcount_t type and API that prevents accidental counter overflows
and underflows. This is important since overflows and underflows
can lead to use-after-free situation and be exploitable.The variable nfs4_pnfs_ds.ds_count is used as pure reference counter.
Convert it to refcount_t and fix up the operations.Suggested-by: Kees Cook
Reviewed-by: David Windsor
Reviewed-by: Hans Liljestrand
Signed-off-by: Elena Reshetova
Signed-off-by: Anna Schumaker
10 Sep, 2017
2 commits
-
It's pretty much a duplicate of nfs_scan_commit_list() that also
clears the PG_COMMIT_TO_DS flag.Signed-off-by: Trond Myklebust
-
Since the commit list is not ordered, it is possible for nfs_scan_commit_list
to hold a request that nfs_lock_and_join_requests() is waiting for, while
at the same time trying to grab a request that nfs_lock_and_join_requests
already holds.Signed-off-by: Trond Myklebust
15 Aug, 2017
3 commits
-
If a request is on the commit list, but is locked, we will currently skip
it, which can lead to livelocking when the commit count doesn't reduce
to zero.Signed-off-by: Trond Myklebust
-
Now that we no longer hold the inode->i_lock when manipulating the
commit lists, it is safe to call pnfs_put_lseg() again.Signed-off-by: Trond Myklebust
-
The commit lists can get very large, so using the inode->i_lock can
end up affecting general metadata performance.Signed-off-by: Trond Myklebust
20 Jul, 2017
3 commits
-
Doing the test without taking any locks is racy, and so really it makes
more sense to do it in the flexfiles code (which is the only case that
cares).Signed-off-by: Trond Myklebust
Signed-off-by: Anna Schumaker -
We must make sure that cinfo->ds->ncommitting is in sync with the
commit list, since it is checked as part of pnfs_commit_list().Signed-off-by: Trond Myklebust
Signed-off-by: Anna Schumaker -
We must make sure that cinfo->ds->nwritten is in sync with the
commit list, since it is checked as part of pnfs_scan_commit_lists().Signed-off-by: Trond Myklebust
Signed-off-by: Anna Schumaker
04 May, 2017
1 commit
-
Signed-off-by: Fred Isaman
Signed-off-by: Trond Myklebust
03 May, 2017
1 commit
-
If the layout segment is invalid, we want to just resend the remaining
writes.Signed-off-by: Trond Myklebust
29 Apr, 2017
1 commit
-
If the layout was invalidated, then assume we should requeue all the
pending writes for the DS in question.Signed-off-by: Trond Myklebust
21 Apr, 2017
2 commits
-
It is not used outside the NFSv4 module.
Signed-off-by: Trond Myklebust
-
When passed GFP flags that allow sleeping (such as
GFP_NOIO), mempool_alloc() will never return NULL, it will
wait until memory is available.This means that we don't need to handle failure, but that we
do need to ensure one thread doesn't call mempool_alloc()
twice on the one pool without queuing or freeing the first
allocation. If multiple threads did this during times of
high memory pressure, the pool could be exhausted and a
deadlock could result.pnfs_generic_alloc_ds_commits() attempts to allocate from
the nfs_commit_mempool while already holding an allocation
from that pool. This is not safe. So change
nfs_commitdata_alloc() to take a flag that indicates whether
failure is acceptable.In pnfs_generic_alloc_ds_commits(), accept failure and
handle it as we currently do. Else where, do not accept
failure, and do not handle it.Even when failure is acceptable, we want to succeed if
possible. That means both
- using an entry from the pool if there is one
- waiting for direct reclaim is there isn't.We call mempool_alloc(GFP_NOWAIT) to achieve the first, then
kmem_cache_alloc(GFP_NOIO|__GFP_NORETRY) to achieve the
second. Each of these can fail, but together they do the
best they can without blocking indefinitely.The objects returned by kmem_cache_alloc() will still be freed
by mempool_free(). This is safe as mempool_alloc() uses
exactly the same function to allocate objects (since the mempool
was created with mempool_create_slab_pool()). The object returned
by mempool_alloc() and kmem_cache_alloc() are indistinguishable
so mempool_free() will handle both identically, either adding to the
pool or calling kmem_cache_free().Also, don't test for failure when allocating from
nfs_wdata_mempool.Signed-off-by: NeilBrown
Signed-off-by: Trond Myklebust
18 Mar, 2017
2 commits
-
The flexfiles layout should never mark a device unavailable.
Move nfs4_mark_deviceid_unavailable out of nfs4_pnfs_ds_connect and call
directly from files layout where it's still needed.The flexfiles driver still handles marked devices in error paths, but will
now print a rate limited warning.Signed-off-by: Weston Andros Adamson
Signed-off-by: Anna Schumaker -
The nfs4_pnfs_ds_connect path can call rpc_create which can fail or it
can wait on another context to reach the same failure.This checks that the rpc_create succeeded and returns the error to the
caller.When an error is returned, both the files and flexfiles layouts will return
NULL from _prepare_ds(). The flexfiles layout will also return the layout
with the error NFS4ERR_NXIO.Signed-off-by: Weston Andros Adamson
Signed-off-by: Anna Schumaker
02 Dec, 2016
1 commit
-
This parameter hasn't been used since f8407299 (Linux 3.11-rc2), so
let's remove it from this function and callers.Signed-off-by: Anna Schumaker
Signed-off-by: Trond Myklebust
20 Sep, 2016
1 commit
-
Try all multipath addresses for a data server. The first address that
successfully connects and creates a session is the DS mount address.
All subsequent addresses are tested for session trunking and
added as aliases.Signed-off-by: Andy Adamson
Signed-off-by: Anna Schumaker