[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1512395795-10022-1-git-send-email-wshilong1991@gmail.com>
Date: Mon, 4 Dec 2017 22:56:35 +0900
From: Wang Shilong <wangshilong1991@...il.com>
To: linux-ext4@...r.kernel.org
Cc: sihara@....com
Subject: [PATCH] e2p: fix getflags for link file
From: Wang Shilong <wshilong@....com>
Steps to reproduce:
$ touch a
$ lsattr -dp a
2000 ----------------P a
$ ln -s a b
$ lsattr -dp b
lsattr: Operation not supported While reading flags on b
Link files should be supported, fix it.
Signed-off-by: Wang Shilong <wshilong@....com>
---
lib/e2p/fgetflags.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/e2p/fgetflags.c b/lib/e2p/fgetflags.c
index 7b93cba..a39cdbd 100644
--- a/lib/e2p/fgetflags.c
+++ b/lib/e2p/fgetflags.c
@@ -73,7 +73,8 @@ int fgetflags (const char * name, unsigned long * flags)
int fd, r, f, save_errno = 0;
if (!lstat(name, &buf) &&
- !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) {
+ !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode) &&
+ !S_ISLNK(buf.st_mode)) {
goto notsupp;
}
#if !APPLE_DARWIN
--
1.8.3.1
Powered by blists - more mailing lists