All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan (metze) Metzmacher" <metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
Cc: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>,
	smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3/8] cifs: add CIFSCheckMFSymlink() as stub
Date: Mon, 09 Aug 2010 16:04:26 +0200	[thread overview]
Message-ID: <4C600AEA.607@samba.org> (raw)
In-Reply-To: <20100805083113.2e7bfbb9-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 5041 bytes --]

Hi,

I noticed that I also need to hook the cifs_readdir() path.

Can someone tell me how I can construct the file name
relative to the mount point. The TODO in this change.

--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -679,7 +679,7 @@ static int cifs_get_name_from_search_buf(struct qstr
*pqst,
        return rc;
 }

-static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t
filldir,
+static int cifs_filldir(int xid, char *pfindEntry, struct file *file,
filldir_t filldir,
                        void *direntry, char *scratch_buf, unsigned int
max_len)
 {
        int rc = 0;
@@ -731,6 +731,15 @@ static int cifs_filldir(char *pfindEntry, struct
file *file, filldir_t filldir,
                cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *)
                                        pfindEntry, cifs_sb);

+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
+               int tmprc;
+               const char *full_path = qstring.name;
+               /* TODO: build full path relative to the mount point */
+               tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
+               if (tmprc)
+                       cFYI(1, "CIFSCheckMFSymlink: %d", tmprc);
+       }
+
        if (inum && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {
                fattr.cf_uniqueid = inum;
        } else {
@@ -856,7 +865,7 @@ int cifs_readdir(struct file *file, void *direntry,
filldir_t filldir)
                        }
                        /* if buggy server returns . and .. late do
                        we want to check for that here? */
-                       rc = cifs_filldir(current_entry, file,
+                       rc = cifs_filldir(xid, current_entry, file,
                                        filldir, direntry, tmp_buf,
max_len);
                        if (rc == -EOVERFLOW) {
                                rc = 0;

metze

Am 05.08.2010 14:31, schrieb Jeff Layton:
> On Thu, 05 Aug 2010 17:40:36 +0530
> Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org> wrote:
> 
>> On 08/04/2010 08:07 PM, Jeff Layton wrote:
>>> On Wed,  4 Aug 2010 16:11:44 +0200
>>> Stefan Metzmacher <metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:
>>>
>>>> Signed-off-by: Stefan Metzmacher <metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
>>>> ---
>>>>  fs/cifs/cifsproto.h |    3 +++
>>>>  fs/cifs/inode.c     |    7 +++++++
>>>>  fs/cifs/link.c      |    8 ++++++++
>>>>  3 files changed, 18 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
>>>> index 2eaebbd..e94e095 100644
>>>> --- a/fs/cifs/cifsproto.h
>>>> +++ b/fs/cifs/cifsproto.h
>>>> @@ -409,4 +409,7 @@ extern int CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
>>>>  extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
>>>>  			const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
>>>>  extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
>>>> +extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr,
>>>> +		const unsigned char *path,
>>>> +		struct cifs_sb_info *cifs_sb, int xid);
>>>>  #endif			/* _CIFSPROTO_H */
>>>> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
>>>> index a15b3a9..c4121de 100644
>>>> --- a/fs/cifs/inode.c
>>>> +++ b/fs/cifs/inode.c
>>>> @@ -661,6 +661,13 @@ int cifs_get_inode_info(struct inode **pinode,
>>>>  	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)
>>>>  		cifs_sfu_mode(&fattr, full_path, cifs_sb, xid);
>>>>  
>>>> +	/* query for SFU type info if supported and needed */
>>>> +	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) {
>>>> +		tmprc = CIFSCheckMFSymlink(&fattr, full_path, cifs_sb, xid);
>>>> +		if (tmprc)
>>>> +			cFYI(1, "CIFSCheckMFSymlink: %d", tmprc);
>>>> +	}
>>>> +
>>>
>>> 		^^^^^^^^^^^^^^
>>>
>>> This only seems to touch the codepath without posix extensions. What
>>> about when unix extensions are enabled? The previous patch seems to
>>> indicate that the behavior is that mfsymlinks are always used when that
>>> mount option is used even if unix extensions are enabled. If so, then I
>>> think you'll need a similar change in cifs_get_inode_info_unix.
>>>
>>
>> I initially thought so. But, looking again - there is no point in
>> querying for SFU type info if unix extensions are enabled..?
>>
>> Thanks,
>>
> 
> I'm not sure that addresses the concern. It's very confusing, but:
> 
>     SFU != POSIX extensions
> 
> The SFU codepath goes through the "normal" cifs code
> (cifs_get_inode_info). The POSIX extensions codepath goes through a
> different codepath (cifs_get_inode_info_unix). Yes, all of this is
> sorely in need of being cleaned up, but that's the way it works today...
> 
> Metze's patches seem to indicate that mfsymlinks and unix extensions
> aren't mutually exclusive. The unix codepaths that determine inode
> type and fill out inode data should be using the mfsymlink stuff too.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  parent reply	other threads:[~2010-08-09 14:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 15:05 [CIFS] Support for Minshall+French symlinks Stefan Metzmacher
     [not found] ` <1280847960-16371-1-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-03 15:05   ` [PATCH 1/8] cifs: add "mfsymlinks" mount option Stefan Metzmacher
     [not found]     ` <1280847960-16371-2-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-05 11:44       ` Suresh Jayaraman
2010-08-03 15:05   ` [PATCH 2/8] cifs: add CIFSCreateMFSymLink() and CIFSQueryMFSymLink() as stubs Stefan Metzmacher
     [not found]     ` <1280847960-16371-3-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-05 11:50       ` Suresh Jayaraman
2010-08-03 15:05   ` [PATCH 3/8] cifs: add CIFSCheckMFSymlink() as stub Stefan Metzmacher
2010-08-03 15:05   ` [PATCH 4/8] cifs: implement CIFSParseMFSymlink() Stefan Metzmacher
2010-08-03 15:05   ` [PATCH 5/8] cifs: implement CIFSCheckMFSymlink() Stefan Metzmacher
2010-08-03 15:05   ` [PATCH 6/8] cifs: implement CIFSQueryMFSymLink() Stefan Metzmacher
     [not found]     ` <1280847960-16371-7-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-03 16:31       ` Jeff Layton
2010-08-03 15:05   ` [PATCH 7/8] cifs: implement CIFSFormatMFSymlink() Stefan Metzmacher
2010-08-03 15:06   ` [PATCH 8/8] cifs: implement CIFSCreateMFSymLink() Stefan Metzmacher
     [not found]     ` <1280847960-16371-9-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-03 15:29       ` Jeff Layton
2010-08-03 18:00   ` [CIFS] Support for Minshall+French symlinks Steve French
     [not found]     ` <AANLkTinJ1WRBT_Q3TqOZdMQExV66LSUAPG4c01yK-XRK-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-04 14:11       ` Stefan Metzmacher
2010-08-04 14:11       ` [PATCH 1/8] cifs: add "mfsymlinks" mount option Stefan Metzmacher
2010-08-04 14:11       ` [PATCH 2/8] cifs: add CIFSCreateMFSymLink() and CIFSQueryMFSymLink() as stubs Stefan Metzmacher
2010-08-04 14:11       ` [PATCH 3/8] cifs: add CIFSCheckMFSymlink() as stub Stefan Metzmacher
     [not found]         ` <1280931109-22380-4-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-04 14:37           ` Jeff Layton
     [not found]             ` <20100804103748.521163e6-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-08-05 12:10               ` Suresh Jayaraman
     [not found]                 ` <4C5AAA3C.1000304-l3A5Bk7waGM@public.gmane.org>
2010-08-05 12:31                   ` Jeff Layton
     [not found]                     ` <20100805083113.2e7bfbb9-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>
2010-08-09 14:04                       ` Stefan (metze) Metzmacher [this message]
     [not found]                         ` <4C600AEA.607-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-09 14:16                           ` Suresh Jayaraman
2010-08-04 14:11       ` [PATCH 4/8] cifs: implement CIFSParseMFSymlink() Stefan Metzmacher
2010-08-04 14:11       ` [PATCH 5/8] cifs: implement CIFSCheckMFSymlink() Stefan Metzmacher
     [not found]         ` <1280931109-22380-6-git-send-email-metze-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-08-04 14:22           ` Jeff Layton
2010-08-05 12:44           ` Suresh Jayaraman
     [not found]             ` <4C5AB228.90800-l3A5Bk7waGM@public.gmane.org>
2010-08-05 15:47               ` Stefan (metze) Metzmacher
2010-08-04 14:11       ` [PATCH 6/8] cifs: implement CIFSQueryMFSymLink() Stefan Metzmacher
2010-08-04 14:11       ` [PATCH 7/8] cifs: implement CIFSFormatMFSymlink() Stefan Metzmacher
2010-08-04 14:11       ` [PATCH 8/8] cifs: implement CIFSCreateMFSymLink() Stefan Metzmacher

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=4C600AEA.607@samba.org \
    --to=metze-eunubhrolfbytjvyw6ydsg@public.gmane.org \
    --cc=jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sjayaraman-l3A5Bk7waGM@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.