public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] btrfs-progs: filesystem: du: skip file that permission denied
@ 2021-11-21 15:15 Sidong Yang
  2021-11-22  7:20 ` Nikolay Borisov
  0 siblings, 1 reply; 9+ messages in thread
From: Sidong Yang @ 2021-11-21 15:15 UTC (permalink / raw)
  To: linux-btrfs, Nikolay Borisov; +Cc: Sidong Yang

This patch handles issue #421. Filesystem du command fails and exit
when it access file that has permission denied. But it can continue the
command except the files. This patch recovers ret value when permission
denied.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
---
 cmds/filesystem-du.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds/filesystem-du.c b/cmds/filesystem-du.c
index 5865335d..fb7753ca 100644
--- a/cmds/filesystem-du.c
+++ b/cmds/filesystem-du.c
@@ -403,7 +403,7 @@ static int du_walk_dir(struct du_dir_ctxt *ctxt, struct rb_root *shared_extents)
 						  dirfd(dirstream),
 						  shared_extents, &tot, &shr,
 						  0);
-				if (ret == -ENOTTY) {
+				if (ret == -ENOTTY || ret == -EACCES) {
 					ret = 0;
 					continue;
 				} else if (ret) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-22 15:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-21 15:15 [PATCH v2] btrfs-progs: filesystem: du: skip file that permission denied Sidong Yang
2021-11-22  7:20 ` Nikolay Borisov
2021-11-22  8:32   ` Sidong Yang
2021-11-22  9:32     ` Nikolay Borisov
2021-11-22  9:53       ` Graham Cobb
2021-11-22 10:57         ` Nikolay Borisov
2021-11-22 15:10           ` Sidong Yang
2021-11-22 15:20             ` Nikolay Borisov
2021-11-22 15:51               ` Sidong Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox