Martin Kaiser (1): nfs: keep server info for remounts
Zhang Yi (1): ext4: remove the redundant folio_wait_stable()
fs/ext4/inode.c | 3 --- fs/nfs/fs_context.c | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-)
From: Martin Kaiser martin@kaiser.cx
mainline inclusion from mainline-v6.10-rc1 commit b322bf9e983addedff0894c55e92d58f4d16d92a bugzilla: https://gitee.com/src-openeuler/kernel/issues/IANSAC
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
With newer kernels that use fs_context for nfs mounts, remounts fail with -EINVAL.
$ mount -t nfs -o nolock 10.0.0.1:/tmp/test /mnt/test/ $ mount -t nfs -o remount /mnt/test/ mount: mounting 10.0.0.1:/tmp/test on /mnt/test failed: Invalid argument
For remounts, the nfs server address and port are populated by nfs_init_fs_context and later overwritten with 0x00 bytes by nfs23_parse_monolithic. The remount then fails as the server address is invalid.
Fix this by not overwriting nfs server info in nfs23_parse_monolithic if we're doing a remount.
Fixes: f2aedb713c28 ("NFS: Add fs_context support.") Signed-off-by: Martin Kaiser martin@kaiser.cx Signed-off-by: Trond Myklebust trond.myklebust@hammerspace.com Conflicts: fs/nfs/fs_context.c [Just context differences.] Signed-off-by: Yifan Qiao qiaoyifan4@huawei.com --- fs/nfs/fs_context.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c index d60c086c6e9c..327b9aaba4ea 100644 --- a/fs/nfs/fs_context.c +++ b/fs/nfs/fs_context.c @@ -962,9 +962,12 @@ static int nfs23_parse_monolithic(struct fs_context *fc, ctx->acdirmax = data->acdirmax; ctx->need_mount = false;
- memcpy(sap, &data->addr, sizeof(data->addr)); - ctx->nfs_server.addrlen = sizeof(data->addr); - ctx->nfs_server.port = ntohs(data->addr.sin_port); + if (!is_remount_fc(fc)) { + memcpy(sap, &data->addr, sizeof(data->addr)); + ctx->nfs_server.addrlen = sizeof(data->addr); + ctx->nfs_server.port = ntohs(data->addr.sin_port); + } + if (sap->sa_family != AF_INET || !nfs_verify_server_address(sap)) goto out_no_address;
From: Zhang Yi yi.zhang@huawei.com
mainline inclusion from mainline-v6.10-rc1 commit df0b5afc62f3368d657a8fe4a8d393ac481474c2 bugzilla: https://gitee.com/src-openeuler/kernel/issues/IANSAC
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
__filemap_get_folio() with FGP_WRITEBEGIN parameter has already wait for stable folio, so remove the redundant folio_wait_stable() in ext4_da_write_begin(), it was left over from the commit cc883236b792 ("ext4: drop unnecessary journal handle in delalloc write") that removed the retry getting page logic.
Fixes: cc883236b792 ("ext4: drop unnecessary journal handle in delalloc write") Signed-off-by: Zhang Yi yi.zhang@huawei.com Reviewed-by: Jan Kara jack@suse.cz Link: https://lore.kernel.org/r/20240419023005.2719050-1-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o tytso@mit.edu Conflicts: fs/ext4/inode.c [Since in 5.10, ext4 has not adapted to folio yet, and grab_cache_page_write_begin also has already wait for stable page. So remove the redundant wait_for_stable_page as removing folio_wait_stable in folio version.] Signed-off-by: Yifan Qiao qiaoyifan4@huawei.com --- fs/ext4/inode.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 8e4407120cbc..c5bf5ab19bb9 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3016,9 +3016,6 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, if (!page) return -ENOMEM;
- /* In case writeback began while the page was unlocked */ - wait_for_stable_page(page); - #ifdef CONFIG_FS_ENCRYPTION ret = ext4_block_write_begin(page, pos, len, ext4_da_get_block_prep);
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/11297 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/M...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/11297 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/M...