* [PATCH 0/2] afs: Miscellaneous fixes
@ 2024-02-19 14:39 David Howells
2024-02-20 8:51 ` Christian Brauner
0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2024-02-19 14:39 UTC (permalink / raw)
To: Christian Brauner
Cc: David Howells, Markus Suvanto, Marc Dionne, Daniil Dulov,
linux-afs, linux-fsdevel, linux-kernel
Hi Christian,
Here are some fixes for afs, if you could take them?
(1) Fix searching for the AFS fileserver record for an incoming callback
in a mixed IPv4/IPv6 environment.
(2) Fix the size of a buffer in afs_update_volume_status() to avoid
overrunning it and use snprintf() as well.
The patches can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes
Thanks,
David
Daniil Dulov (1):
afs: Increase buffer size in afs_update_volume_status()
Marc Dionne (1):
afs: Fix ignored callbacks over ipv4
fs/afs/internal.h | 6 ++----
fs/afs/main.c | 3 +--
fs/afs/server.c | 14 +++++---------
fs/afs/volume.c | 4 ++--
4 files changed, 10 insertions(+), 17 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] afs: Miscellaneous fixes
2024-02-19 14:39 David Howells
@ 2024-02-20 8:51 ` Christian Brauner
0 siblings, 0 replies; 8+ messages in thread
From: Christian Brauner @ 2024-02-20 8:51 UTC (permalink / raw)
To: David Howells
Cc: Christian Brauner, Markus Suvanto, Marc Dionne, Daniil Dulov,
linux-afs, linux-fsdevel, linux-kernel
On Mon, 19 Feb 2024 14:39:01 +0000, David Howells wrote:
> Here are some fixes for afs, if you could take them?
>
> (1) Fix searching for the AFS fileserver record for an incoming callback
> in a mixed IPv4/IPv6 environment.
>
> (2) Fix the size of a buffer in afs_update_volume_status() to avoid
> overrunning it and use snprintf() as well.
>
> [...]
vfs.fixes means that these things will go in this week. Let me know if
this is not what you intended! :)
---
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/2] afs: Fix ignored callbacks over ipv4
https://git.kernel.org/vfs/vfs/c/bfacaf71a148
[2/2] afs: Increase buffer size in afs_update_volume_status()
https://git.kernel.org/vfs/vfs/c/6ea38e2aeb72
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/2] afs: Miscellaneous fixes
@ 2024-03-13 8:15 David Howells
2024-03-13 12:55 ` Marc Dionne
2024-03-14 11:13 ` Christian Brauner
0 siblings, 2 replies; 8+ messages in thread
From: David Howells @ 2024-03-13 8:15 UTC (permalink / raw)
To: Marc Dionne
Cc: David Howells, Christian Brauner, linux-afs, linux-fsdevel,
linux-kernel
Hi Marc,
Here are some fixes for afs, if you could look them over?
(1) Fix the caching of preferred address of a fileserver. By doing that, we
stick with whatever address we get a response back from first rather then
obeying any preferences set.
(2) Fix an occasional FetchStatus-after-RemoveDir. The FetchStatus then
fails with VNOVNODE (equivalent to -ENOENT) that confuses parts of the
driver that aren't expecting that.
The patches can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes
Thanks,
David
David Howells (2):
afs: Don't cache preferred address
afs: Fix occasional rmdir-then-VNOVNODE with generic/011
fs/afs/rotate.c | 21 ++++-----------------
fs/afs/validation.c | 16 +++++++++-------
2 files changed, 13 insertions(+), 24 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] afs: Miscellaneous fixes
2024-03-13 8:15 [PATCH 0/2] afs: Miscellaneous fixes David Howells
@ 2024-03-13 12:55 ` Marc Dionne
2024-03-14 11:13 ` Christian Brauner
1 sibling, 0 replies; 8+ messages in thread
From: Marc Dionne @ 2024-03-13 12:55 UTC (permalink / raw)
To: David Howells; +Cc: Christian Brauner, linux-afs, linux-fsdevel, linux-kernel
On Wed, Mar 13, 2024 at 5:15 AM David Howells <dhowells@redhat.com> wrote:
>
> Hi Marc,
>
> Here are some fixes for afs, if you could look them over?
>
> (1) Fix the caching of preferred address of a fileserver. By doing that, we
> stick with whatever address we get a response back from first rather then
> obeying any preferences set.
>
> (2) Fix an occasional FetchStatus-after-RemoveDir. The FetchStatus then
> fails with VNOVNODE (equivalent to -ENOENT) that confuses parts of the
> driver that aren't expecting that.
>
> The patches can be found here:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes
>
> Thanks,
> David
>
> David Howells (2):
> afs: Don't cache preferred address
> afs: Fix occasional rmdir-then-VNOVNODE with generic/011
>
> fs/afs/rotate.c | 21 ++++-----------------
> fs/afs/validation.c | 16 +++++++++-------
> 2 files changed, 13 insertions(+), 24 deletions(-)
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
Marc
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] afs: Miscellaneous fixes
2024-03-13 8:15 [PATCH 0/2] afs: Miscellaneous fixes David Howells
2024-03-13 12:55 ` Marc Dionne
@ 2024-03-14 11:13 ` Christian Brauner
1 sibling, 0 replies; 8+ messages in thread
From: Christian Brauner @ 2024-03-14 11:13 UTC (permalink / raw)
To: Marc Dionne, David Howells
Cc: Christian Brauner, linux-afs, linux-fsdevel, linux-kernel
On Wed, 13 Mar 2024 08:15:01 +0000, David Howells wrote:
> Here are some fixes for afs, if you could look them over?
>
> (1) Fix the caching of preferred address of a fileserver. By doing that, we
> stick with whatever address we get a response back from first rather then
> obeying any preferences set.
>
> (2) Fix an occasional FetchStatus-after-RemoveDir. The FetchStatus then
> fails with VNOVNODE (equivalent to -ENOENT) that confuses parts of the
> driver that aren't expecting that.
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/2] afs: Don't cache preferred address
https://git.kernel.org/vfs/vfs/c/b719dcc8b02d
[2/2] afs: Fix occasional rmdir-then-VNOVNODE with generic/011
https://git.kernel.org/vfs/vfs/c/4eed8f8549f4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/2] afs: Miscellaneous fixes
@ 2026-07-29 14:17 David Howells
2026-07-29 14:17 ` [PATCH 1/2] afs: Fix missing kunmap in afs_dir_search_bucket() David Howells
2026-07-29 14:17 ` [PATCH 2/2] afs: Fix double-unmap of directory block David Howells
0 siblings, 2 replies; 8+ messages in thread
From: David Howells @ 2026-07-29 14:17 UTC (permalink / raw)
To: Christian Brauner
Cc: David Howells, Marc Dionne, linux-afs, linux-fsdevel,
linux-kernel
Hi Christian,
Can you pick up these miscellaneous AFS fixes, please? They were found by
Sashiko[1].
(1) Fix missing kunmap in afs_dir_search_bucket().
(2) Fix double-unmap of directory block.
The patches can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes
Thanks,
David
[1] https://sashiko.dev/#/patchset/20260716103030.3065561-1-dhowells%40redhat.com
David Howells (2):
afs: Fix missing kunmap in afs_dir_search_bucket()
afs: Fix double-unmap of directory block
fs/afs/dir_edit.c | 9 ++-------
fs/afs/dir_search.c | 11 ++---------
fs/afs/internal.h | 8 ++++++++
3 files changed, 12 insertions(+), 16 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] afs: Fix missing kunmap in afs_dir_search_bucket()
2026-07-29 14:17 [PATCH 0/2] afs: Miscellaneous fixes David Howells
@ 2026-07-29 14:17 ` David Howells
2026-07-29 14:17 ` [PATCH 2/2] afs: Fix double-unmap of directory block David Howells
1 sibling, 0 replies; 8+ messages in thread
From: David Howells @ 2026-07-29 14:17 UTC (permalink / raw)
To: Christian Brauner
Cc: David Howells, Marc Dionne, linux-afs, linux-fsdevel,
linux-kernel, stable
Fix afs_dir_search_bucket() to kunmap the block it's using in the "bad:"
path.
Fixes: a5b5beebcf96 ("afs: Use the contained hashtable to search a directory")
Closes: https://sashiko.dev/#/patchset/20260716103030.3065561-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
cc: stable@vger.kernel.org
---
fs/afs/dir_search.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/afs/dir_search.c b/fs/afs/dir_search.c
index 104411c0692f..4977ad81fa82 100644
--- a/fs/afs/dir_search.c
+++ b/fs/afs/dir_search.c
@@ -173,12 +173,11 @@ int afs_dir_search_bucket(struct afs_dir_iter *iter, const struct qstr *name,
ret = -ENOENT;
found:
+bad:
if (iter->block) {
kunmap_local(iter->block);
iter->block = NULL;
}
-
-bad:
if (ret == -ESTALE)
afs_invalidate_dir(iter->dvnode, afs_dir_invalid_iter_stale);
_leave(" = %d", ret);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] afs: Fix double-unmap of directory block
2026-07-29 14:17 [PATCH 0/2] afs: Miscellaneous fixes David Howells
2026-07-29 14:17 ` [PATCH 1/2] afs: Fix missing kunmap in afs_dir_search_bucket() David Howells
@ 2026-07-29 14:17 ` David Howells
1 sibling, 0 replies; 8+ messages in thread
From: David Howells @ 2026-07-29 14:17 UTC (permalink / raw)
To: Christian Brauner
Cc: David Howells, Marc Dionne, linux-afs, linux-fsdevel,
linux-kernel, stable
Fix afs_edit_dir_remove() to use a cleanup function to unmap the block
pointed to by afs_dir_iter::block if it's left pointing to something rather
than manually kunmapping the blocks. Manually kunmapping without clearing
iter.blocks can result in a double-kunmap if afs_dir_find_block() is called
twice in a row (which would be the case if the block being modified is not
first in the hash chain).
Fixes: a5b5beebcf96 ("afs: Use the contained hashtable to search a directory")
Closes: https://sashiko.dev/#/patchset/20260716103030.3065561-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-fsdevel@vger.kernel.org
cc: stable@vger.kernel.org
---
fs/afs/dir_edit.c | 9 ++-------
fs/afs/dir_search.c | 10 ++--------
fs/afs/internal.h | 8 ++++++++
3 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/fs/afs/dir_edit.c b/fs/afs/dir_edit.c
index 3ead36a07048..c31303059444 100644
--- a/fs/afs/dir_edit.c
+++ b/fs/afs/dir_edit.c
@@ -442,7 +442,7 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
/* Check and clear the entry. */
de = &block->dirents[slot];
if (de->u.valid != 1)
- goto error_unmap;
+ goto error;
trace_afs_edit_dir(vnode, why, afs_edit_dir_delete, b, slot,
ntohl(de->u.vnode), ntohl(de->u.unique),
@@ -458,7 +458,6 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
/* Clear the constituent entries. */
next = de->u.hash_next;
memset(de, 0, sizeof(*de) * iter.nr_slots);
- kunmap_local(block);
/* Adjust the hash chain: if iter->prev_entry is 0, the hashtable head
* index is previous; otherwise it's slot number of the previous entry.
@@ -485,7 +484,6 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
pde = &pblock->dirents[ps];
prev_next = pde->u.hash_next;
if (prev_next != htons(entry)) {
- kunmap_local(pblock);
pr_warn("%llx:%llx:%x: not prev in chain b=%x p=%x,%x e=%x %*s",
vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique,
iter.bucket, iter.prev_entry, prev_next, entry,
@@ -493,7 +491,6 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
goto error;
}
pde->u.hash_next = next;
- kunmap_local(pblock);
}
netfs_single_mark_inode_dirty(&vnode->netfs.inode);
@@ -503,18 +500,16 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
_debug("Remove %s from %u[%u]", name->name, b, slot);
out_unmap:
+ afs_dir_end_iter(&iter);
kunmap_local(meta);
_leave("");
return;
already_invalidated:
- kunmap_local(block);
trace_afs_edit_dir(vnode, why, afs_edit_dir_delete_inval,
0, 0, 0, 0, name->name);
goto out_unmap;
-error_unmap:
- kunmap_local(block);
error:
trace_afs_edit_dir(vnode, why, afs_edit_dir_delete_error,
0, 0, 0, 0, name->name);
diff --git a/fs/afs/dir_search.c b/fs/afs/dir_search.c
index 4977ad81fa82..11ebdfffcb1d 100644
--- a/fs/afs/dir_search.c
+++ b/fs/afs/dir_search.c
@@ -75,10 +75,7 @@ union afs_xdr_dir_block *afs_dir_find_block(struct afs_dir_iter *iter, size_t bl
_enter("%zx,%d", block, slot);
- if (iter->block) {
- kunmap_local(iter->block);
- iter->block = NULL;
- }
+ afs_dir_end_iter(iter);
if (dvnode->directory_size < blend)
goto fail;
@@ -174,10 +171,7 @@ int afs_dir_search_bucket(struct afs_dir_iter *iter, const struct qstr *name,
ret = -ENOENT;
found:
bad:
- if (iter->block) {
- kunmap_local(iter->block);
- iter->block = NULL;
- }
+ afs_dir_end_iter(iter);
if (ret == -ESTALE)
afs_invalidate_dir(iter->dvnode, afs_dir_invalid_iter_stale);
_leave(" = %d", ret);
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 290873bac89b..330654ed16ec 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -1133,6 +1133,14 @@ int afs_dir_search_bucket(struct afs_dir_iter *iter, const struct qstr *name,
int afs_dir_search(struct afs_vnode *dvnode, const struct qstr *name,
struct afs_fid *_fid, afs_dataversion_t *_dir_version);
+static inline void afs_dir_end_iter(struct afs_dir_iter *iter)
+{
+ if (iter->block) {
+ kunmap_local(iter->block);
+ iter->block = NULL;
+ }
+}
+
/*
* dir_silly.c
*/
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-29 14:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29 14:17 [PATCH 0/2] afs: Miscellaneous fixes David Howells
2026-07-29 14:17 ` [PATCH 1/2] afs: Fix missing kunmap in afs_dir_search_bucket() David Howells
2026-07-29 14:17 ` [PATCH 2/2] afs: Fix double-unmap of directory block David Howells
-- strict thread matches above, loose matches on Subject: below --
2024-03-13 8:15 [PATCH 0/2] afs: Miscellaneous fixes David Howells
2024-03-13 12:55 ` Marc Dionne
2024-03-14 11:13 ` Christian Brauner
2024-02-19 14:39 David Howells
2024-02-20 8:51 ` Christian Brauner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.