[PATCH] e2p: fix getflags for link file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wang Shilong <wshilong@xxxxxxx>

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@xxxxxxx>
---
 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




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux