From patchwork Fri Aug 26 18:03:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1102632 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7QI3JDv021278 for ; Fri, 26 Aug 2011 18:03:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755418Ab1HZSDP (ORCPT ); Fri, 26 Aug 2011 14:03:15 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:42315 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752182Ab1HZSDN (ORCPT ); Fri, 26 Aug 2011 14:03:13 -0400 Received: by bke11 with SMTP id 11so2731740bke.19 for ; Fri, 26 Aug 2011 11:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer; bh=T5Zj2Os/KgqS2v07LNgXF0njw68wYJzxbtcek9RTtQY=; b=n/Yc6uZaRrvkLdgiPuAiRH8vgmjlb1ZnzPMGZEGNQV9wW+rcj7sZ4SpR9i2hvjwKfj 5FuE+jofE4HsPbNY3y2RfCL0Ui2Pb5TbsE+A+ZSHhwajvRCO4YPQ5JAN5hOQRERT7G7A pVFrOzqOCv4BmTEL1PdH3BgS9CvycPEBRfGq4= Received: by 10.204.145.211 with SMTP id e19mr802885bkv.33.1314381791942; Fri, 26 Aug 2011 11:03:11 -0700 (PDT) Received: from localhost.localdomain ([79.126.89.147]) by mx.google.com with ESMTPS id n11sm528200bkd.14.2011.08.26.11.03.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Aug 2011 11:03:10 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH] CIFS: Fix the conflict between rwpidforward and rw mount options Date: Fri, 26 Aug 2011 22:03:03 +0400 Message-Id: <1314381783-5614-1-git-send-email-piastry@etersoft.ru> X-Mailer: git-send-email 1.7.1 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 26 Aug 2011 18:03:19 +0000 (UTC) Both these options are started with "rw" - that's why the first one isn't switched on even if it is specified. Rename it to piforwardio to avoid the wrong matching. Signed-off-by: Pavel Shilovsky --- fs/cifs/README | 2 +- fs/cifs/cifs_fs_sb.h | 2 +- fs/cifs/cifsfs.c | 6 ++++-- fs/cifs/cifsglob.h | 2 +- fs/cifs/connect.c | 8 ++++---- fs/cifs/file.c | 10 +++++----- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/fs/cifs/README b/fs/cifs/README index c5c2c5e..a943855 100644 --- a/fs/cifs/README +++ b/fs/cifs/README @@ -457,7 +457,7 @@ A partial list of the supported mount options follows: otherwise - read from the server. All written data are stored in the cache, but if the client doesn't have Exclusive Oplock, it writes the data to the server. - rwpidforward Forward pid of a process who opened a file to any read or write + pidforwardio Forward pid of a process who opened a file to any read or write operation on that file. This prevent applications like WINE from failing on read and write if we use mandatory brlock style. acl Allow setfacl and getfacl to manage posix ACLs if server diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h index 7260e11..2a74b6f 100644 --- a/fs/cifs/cifs_fs_sb.h +++ b/fs/cifs/cifs_fs_sb.h @@ -41,7 +41,7 @@ #define CIFS_MOUNT_MF_SYMLINKS 0x10000 /* Minshall+French Symlinks enabled */ #define CIFS_MOUNT_MULTIUSER 0x20000 /* multiuser mount */ #define CIFS_MOUNT_STRICT_IO 0x40000 /* strict cache mode */ -#define CIFS_MOUNT_RWPIDFORWARD 0x80000 /* use pid forwarding for rw */ +#define CIFS_MOUNT_PIDFORWARD_IO 0x80000 /* use pid forwarding for rw */ #define CIFS_MOUNT_POSIXACL 0x100000 /* mirror of MS_POSIXACL in mnt_cifs_flags */ struct cifs_sb_info { diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index f93eb94..1b16773 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -408,10 +408,12 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) seq_printf(s, ",setuids"); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) seq_printf(s, ",serverino"); - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) - seq_printf(s, ",rwpidforward"); + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_PIDFORWARD_IO) + seq_printf(s, ",pidforwardio"); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) seq_printf(s, ",forcemand"); + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) + seq_printf(s, ",strictcache"); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) seq_printf(s, ",directio"); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 95dad9d..a37452d 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -200,7 +200,7 @@ struct smb_vol { bool fsc:1; /* enable fscache */ bool mfsymlinks:1; /* use Minshall+French Symlinks */ bool multiuser:1; - bool rwpidforward:1; /* pid forward for read/write operations */ + bool pidforwardio:1; /* pid forward for read/write operations */ unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 633c246..2cadc34 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1401,8 +1401,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, vol->server_ino = 1; } else if (strnicmp(data, "noserverino", 9) == 0) { vol->server_ino = 0; - } else if (strnicmp(data, "rwpidforward", 4) == 0) { - vol->rwpidforward = 1; + } else if (strnicmp(data, "pidforwardio", 12) == 0) { + vol->pidforwardio = 1; } else if (strnicmp(data, "cifsacl", 7) == 0) { vol->cifs_acl = 1; } else if (strnicmp(data, "nocifsacl", 9) == 0) { @@ -2759,8 +2759,8 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOSSYNC; if (pvolume_info->mand_lock) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOPOSIXBRL; - if (pvolume_info->rwpidforward) - cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_RWPIDFORWARD; + if (pvolume_info->pidforwardio) + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_PIDFORWARD_IO; if (pvolume_info->cifs_acl) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_ACL; if (pvolume_info->override_uid) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 9f41a10..bfa7c26 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1352,7 +1352,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb); __u32 pid; - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_PIDFORWARD_IO) pid = cfile->pid; else pid = current->tgid; @@ -1579,7 +1579,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov, xid = GetXid(); open_file = file->private_data; - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_PIDFORWARD_IO) pid = open_file->pid; else pid = current->tgid; @@ -1729,7 +1729,7 @@ cifs_iovec_read(struct file *file, const struct iovec *iov, open_file = file->private_data; pTcon = tlink_tcon(open_file->tlink); - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_PIDFORWARD_IO) pid = open_file->pid; else pid = current->tgid; @@ -1850,7 +1850,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, open_file = file->private_data; pTcon = tlink_tcon(open_file->tlink); - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_PIDFORWARD_IO) pid = open_file->pid; else pid = current->tgid; @@ -2044,7 +2044,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, goto read_complete; cFYI(DBG2, "rpages: num pages %d", num_pages); - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_PIDFORWARD_IO) pid = open_file->pid; else pid = current->tgid;