From patchwork Thu Feb 26 21:24:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 9046 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1QLPKEC016636 for ; Thu, 26 Feb 2009 21:25:20 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 96310163B61 for ; Thu, 26 Feb 2009 21:25:06 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=3.8 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail.etersoft.ru (mail.etersoft.ru [87.249.47.46]) by lists.samba.org (Postfix) with ESMTP id 7D7B3163B27 for ; Thu, 26 Feb 2009 21:24:54 +0000 (GMT) Received: from localhost (as.office.etersoft.ru [192.168.0.10]) by mail.etersoft.ru (Postfix) with ESMTP id 250A624E51E for ; Fri, 27 Feb 2009 00:25:07 +0300 (MSK) X-Virus-Scanned: amavisd-new at office.etersoft.ru Received: from mail.etersoft.ru ([192.168.0.1]) by localhost (as.office.etersoft.ru [192.168.0.10]) (amavisd-new, port 10024) with LMTP id ABwx-TLUzImW for ; Fri, 27 Feb 2009 00:25:04 +0300 (MSK) Received: from homestation.localnet (pppoe-88-147-213-93.san.ru [88.147.213.93]) by mail.etersoft.ru (Postfix) with ESMTP id BCA152F0D89 for ; Fri, 27 Feb 2009 00:25:04 +0300 (MSK) From: Pavel Shilovsky To: linux-cifs-client@lists.samba.org Date: Fri, 27 Feb 2009 00:24:58 +0300 User-Agent: KMail/1.10.3 (Linux/2.6.26-1-686; KDE/4.1.3; i686; ; ) MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200902270024.58900.piastry@etersoft.ru> Subject: [linux-cifs-client] mkdir -p problem X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Hello! I have such a situation. I mount samba share with uid options and try to exec mkdir command. I have that cifs driver don't set uid during the one second - that's why i have a problem with creating hierarchy of directories. Cifs creates the first directory and when it try to create the second in it gets permission denied because driver don't set uid that I chose during mounting. I looked on the code and found such an interesting thing: when driver create directory, it calls posix_fill_in_inode() function that calls cifs_unix_info_to_inode() with force_uid_gid = 1 - driver don't set mnt_uid and mnt_gid after creating even if they were chosen. That's why when I tried to "mkdir -p 1/2/3" in root share directory it failed. I patched it with: and mkdir -p worked successful. Is it a bug or there are some other reason to do this? diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 9c548f1..e02de2b 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -843,7 +843,7 @@ static void posix_fill_in_inode(struct inode *tmp_inode, local_mtime = tmp_inode->i_mtime; local_size = tmp_inode->i_size; - cifs_unix_info_to_inode(tmp_inode, pData, 1); + cifs_unix_info_to_inode(tmp_inode, pData, 0); cifs_set_ops(tmp_inode, false); if (!S_ISREG(tmp_inode->i_mode))