* [PATCH] e2p: fix getflags for link file
@ 2017-12-04 13:56 Wang Shilong
2017-12-05 16:10 ` Theodore Ts'o
0 siblings, 1 reply; 4+ messages in thread
From: Wang Shilong @ 2017-12-04 13:56 UTC (permalink / raw)
To: linux-ext4; +Cc: sihara
From: Wang Shilong <wshilong@ddn.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@ddn.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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] e2p: fix getflags for link file
2017-12-04 13:56 [PATCH] e2p: fix getflags for link file Wang Shilong
@ 2017-12-05 16:10 ` Theodore Ts'o
2017-12-06 0:41 ` Wang Shilong
0 siblings, 1 reply; 4+ messages in thread
From: Theodore Ts'o @ 2017-12-05 16:10 UTC (permalink / raw)
To: Wang Shilong; +Cc: linux-ext4, sihara
On Mon, Dec 04, 2017 at 10:56:35PM +0900, Wang Shilong wrote:
> From: Wang Shilong <wshilong@ddn.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@ddn.com>
You can't actually set or get the extended attributes for a symlink;
the *kernel* doesn't support what you seem to be hoping to achieve.
This patch result in fgetflags() following the symlink and opening
whatever file it points at.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] e2p: fix getflags for link file
2017-12-05 16:10 ` Theodore Ts'o
@ 2017-12-06 0:41 ` Wang Shilong
[not found] ` <CAP9B-Qnu=SrKx60q7B1Wyzd_a_Po-vX3Ah_avTnFudZO2PsAyw@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Wang Shilong @ 2017-12-06 0:41 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Ext4 Developers List, Shuichi Ihara, Wang Shilong
On Wed, Dec 6, 2017 at 12:10 AM, Theodore Ts'o <tytso@mit.edu> wrote:
>
> On Mon, Dec 04, 2017 at 10:56:35PM +0900, Wang Shilong wrote:
> > From: Wang Shilong <wshilong@ddn.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@ddn.com>
>
> You can't actually set or get the extended attributes for a symlink;
> the *kernel* doesn't support what you seem to be hoping to achieve.
> This patch result in fgetflags() following the symlink and opening
> whatever file it points at.
Yup, you are right.
But this is one of our customers feedback, this is not good that
lsattr/chattr did not support symlink, we might need make it
clear, for example, we support symlink, but it always follow
original files, that is even better than output errors.
In this way, we need fix chattr too.
What do you think?
Thanks,
Shilong
>
> - Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-06 2:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-04 13:56 [PATCH] e2p: fix getflags for link file Wang Shilong
2017-12-05 16:10 ` Theodore Ts'o
2017-12-06 0:41 ` Wang Shilong
[not found] ` <CAP9B-Qnu=SrKx60q7B1Wyzd_a_Po-vX3Ah_avTnFudZO2PsAyw@mail.gmail.com>
2017-12-06 2:44 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).