From: Sergei Antonov <saproj@gmail.com>
To: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Hin-Tak Leung <htl10@users.sourceforge.net>
Subject: Re: [PATCH] hfsplus: emit symlinks from readdir properly
Date: Wed, 7 May 2014 16:51:27 +0200 [thread overview]
Message-ID: <CABikg9xK2Og4ROHLzLu0GZ7jKmYSJE_rJzk0-UMKNKxpr1GFBA@mail.gmail.com> (raw)
In-Reply-To: <1399472320.2400.19.camel@slavad-CELSIUS-H720>
On 7 May 2014 16:18, Vyacheslav Dubeyko <slava@dubeyko.com> wrote:
> Hi Sergei,
>
> On Wed, 2014-05-07 at 14:08 +0200, Sergei Antonov wrote:
>> hfsplus_readdir() did not return DT_LNK record type for symbolic links. It
>> emitted them as regular files (DT_REG). Programs relying on information from
>> readdir did not work correctly with HFS+.
>>
>
> This patch looks good for me. But what about another file types
> (S_IFIFO, S_IFCHR, S_IFBLK, S_IFSOCK)?
I will resubmit to support them too. Thanks.
In this patch I tried to fix the problem I faced (and it was with
symlinks). Now I see that the fix can be broader. Resubmitting in a
minute.
> Thanks,
> Vyacheslav Dubeyko.
>
>> CC: Al Viro <viro@zeniv.linux.org.uk>
>> CC: Christoph Hellwig <hch@infradead.org>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: Vyacheslav Dubeyko <slava@dubeyko.com>
>> CC: Hin-Tak Leung <htl10@users.sourceforge.net>
>> Signed-off-by: Sergei Antonov <saproj@gmail.com>
>> ---
>> fs/hfsplus/dir.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
>> index bdec665..c5ccb11 100644
>> --- a/fs/hfsplus/dir.c
>> +++ b/fs/hfsplus/dir.c
>> @@ -212,13 +212,17 @@ static int hfsplus_readdir(struct file *file, struct dir_context *ctx)
>> be32_to_cpu(entry.folder.id), DT_DIR))
>> break;
>> } else if (type == HFSPLUS_FILE) {
>> + u16 mode;
>> +
>> if (fd.entrylength < sizeof(struct hfsplus_cat_file)) {
>> pr_err("small file entry\n");
>> err = -EIO;
>> goto out;
>> }
>> + mode = be16_to_cpu(entry.file.permissions.mode);
>> if (!dir_emit(ctx, strbuf, len,
>> - be32_to_cpu(entry.file.id), DT_REG))
>> + be32_to_cpu(entry.file.id),
>> + S_ISLNK(mode) ? DT_LNK : DT_REG))
>> break;
>> } else {
>> pr_err("bad catalog entry type\n");
>
>
next prev parent reply other threads:[~2014-05-07 14:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 12:08 [PATCH] hfsplus: emit symlinks from readdir properly Sergei Antonov
2014-05-07 14:18 ` Vyacheslav Dubeyko
2014-05-07 14:51 ` Sergei Antonov [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-05-07 12:20 Hin-Tak Leung
2014-05-07 12:27 ` Sergei Antonov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABikg9xK2Og4ROHLzLu0GZ7jKmYSJE_rJzk0-UMKNKxpr1GFBA@mail.gmail.com \
--to=saproj@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=htl10@users.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=slava@dubeyko.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).