1 Star 0 Fork 71

clcl/coreutils

forked from src-openEuler/coreutils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-stat-only-automount-with-cached-never.patch 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
panxiaohe 提交于 2022-03-29 18:50 . backport patches from upstream
From 92cb8427c537f37edd43c5cef1909585201372ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Mon, 7 Mar 2022 23:29:20 +0000
Subject: [PATCH] stat: only automount with --cached=never
Revert to the default behavior before the introduction of statx().
* src/stat.c (do_stat): Set AT_NO_AUTOMOUNT without --cached=never.
* doc/coreutils.texi (stat invocation): Mention the automount
behavior with --cached=never.
* NEWS: Mention the change in behavior.
Fixes https://bugs.gnu.org/54287
---
doc/coreutils.texi | 1 +
src/stat.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e9be0993ac..05dc5ee21f 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12608,6 +12608,7 @@ Always read the already cached attributes if available.
@item never
Always sychronize with the latest file system attributes.
+This also mounts automounted files.
@item default
Leave the caching behavior to the underlying file system.
diff --git a/src/stat.c b/src/stat.c
index edafd02854..3765a8f65a 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -1394,6 +1394,9 @@ do_stat (char const *filename, char const *format, char const *format2)
else if (force_sync)
flags |= AT_STATX_FORCE_SYNC;
+ if (! force_sync)
+ flags |= AT_NO_AUTOMOUNT;
+
fd = statx (fd, pathname, flags, format_to_mask (format), &stx);
if (fd < 0)
{
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wd40/coreutils.git
git@gitee.com:wd40/coreutils.git
wd40
coreutils
coreutils
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385