From 6dbcb877592c6d3b850975643b0e01ec8d4bce3d Mon Sep 17 00:00:00 2001 From: "Pallipadi, Venkatesh" Date: Wed, 29 Jul 2009 13:36:10 -0700 Subject: [PATCH] --- yaml --- r: 156217 b: refs/heads/master c: 26d204afa18f7df177f21bdb3759e0098ca8f7d5 h: refs/heads/master i: 156215: b38302c7b75b30e0dc922352123b5876a8966dd4 v: v3 --- [refs] | 2 +- trunk/drivers/cpufreq/cpufreq_conservative.c | 6 +++ trunk/fs/cifs/CHANGES | 7 --- trunk/fs/cifs/README | 25 ++++----- trunk/fs/cifs/cifs_dfs_ref.c | 12 ++--- trunk/fs/cifs/cifs_unicode.c | 2 +- trunk/fs/cifs/cifsfs.c | 4 -- trunk/fs/cifs/connect.c | 55 ++++++-------------- trunk/fs/nilfs2/mdt.c | 4 +- trunk/fs/nilfs2/segment.c | 16 +----- 10 files changed, 41 insertions(+), 92 deletions(-) diff --git a/[refs] b/[refs] index 3e9ae1358f06..4fc69f19c94b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 624720e09c9b7913ef4bc6989878a6fcb7ecdff8 +refs/heads/master: 26d204afa18f7df177f21bdb3759e0098ca8f7d5 diff --git a/trunk/drivers/cpufreq/cpufreq_conservative.c b/trunk/drivers/cpufreq/cpufreq_conservative.c index 57490502b21c..bdea7e2f94ba 100644 --- a/trunk/drivers/cpufreq/cpufreq_conservative.c +++ b/trunk/drivers/cpufreq/cpufreq_conservative.c @@ -63,6 +63,7 @@ struct cpu_dbs_info_s { unsigned int down_skip; unsigned int requested_freq; int cpu; + unsigned int enable:1; /* * percpu mutex that serializes governor limit change with * do_dbs_timer invocation. We do not want do_dbs_timer to run @@ -141,6 +142,9 @@ dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, struct cpufreq_policy *policy; + if (!this_dbs_info->enable) + return 0; + policy = this_dbs_info->cur_policy; /* @@ -497,6 +501,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); delay -= jiffies % delay; + dbs_info->enable = 1; INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work, delay); @@ -504,6 +509,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) { + dbs_info->enable = 0; cancel_delayed_work_sync(&dbs_info->work); } diff --git a/trunk/fs/cifs/CHANGES b/trunk/fs/cifs/CHANGES index e85b1e4389e0..92888aa90749 100644 --- a/trunk/fs/cifs/CHANGES +++ b/trunk/fs/cifs/CHANGES @@ -1,10 +1,3 @@ -Version 1.60 -------------- -Fix memory leak in reconnect. Fix oops in DFS mount error path. -Set s_maxbytes to smaller (the max that vfs can handle) so that -sendfile will now work over cifs mounts again. Add noforcegid -and noforceuid mount parameters. - Version 1.59 ------------ Client uses server inode numbers (which are persistent) rather than diff --git a/trunk/fs/cifs/README b/trunk/fs/cifs/README index 79c1a93400be..ad92921dbde4 100644 --- a/trunk/fs/cifs/README +++ b/trunk/fs/cifs/README @@ -262,11 +262,11 @@ A partial list of the supported mount options follows: mount. domain Set the SMB/CIFS workgroup name prepended to the username during CIFS session establishment - forceuid Set the default uid for inodes to the uid - passed in on mount. For mounts to servers + forceuid Set the default uid for inodes based on the uid + passed in. For mounts to servers which do support the CIFS Unix extensions, such as a properly configured Samba server, the server provides - the uid, gid and mode so this parameter should not be + the uid, gid and mode so this parameter should not be specified unless the server and clients uid and gid numbering differ. If the server and client are in the same domain (e.g. running winbind or nss_ldap) and @@ -278,7 +278,11 @@ A partial list of the supported mount options follows: of existing files will be the uid (gid) of the person who executed the mount (root, except when mount.cifs is configured setuid for user mounts) unless the "uid=" - (gid) mount option is specified. Also note that permission + (gid) mount option is specified. For the uid (gid) of newly + created files and directories, ie files created since + the last mount of the server share, the expected uid + (gid) is cached as long as the inode remains in + memory on the client. Also note that permission checks (authorization checks) on accesses to a file occur at the server, but there are cases in which an administrator may want to restrict at the client as well. For those @@ -286,15 +290,12 @@ A partial list of the supported mount options follows: (such as Windows), permissions can also be checked at the client, and a crude form of client side permission checking can be enabled by specifying file_mode and dir_mode on - the client. (default) - forcegid (similar to above but for the groupid instead of uid) (default) - noforceuid Fill in file owner information (uid) by requesting it from - the server if possible. With this option, the value given in - the uid= option (on mount) will only be used if the server - can not support returning uids on inodes. - noforcegid (similar to above but for the group owner, gid, instead of uid) + the client. Note that the mount.cifs helper must be + at version 1.10 or higher to support specifying the uid + (or gid) in non-numeric form. + forcegid (similar to above but for the groupid instead of uid) uid Set the default uid for inodes, and indicate to the - cifs kernel driver which local user mounted. If the server + cifs kernel driver which local user mounted . If the server supports the unix extensions the default uid is not used to fill in the owner fields of inodes (files) unless the "forceuid" parameter is specified. diff --git a/trunk/fs/cifs/cifs_dfs_ref.c b/trunk/fs/cifs/cifs_dfs_ref.c index 606912d8f2a8..3bb11be8b6a8 100644 --- a/trunk/fs/cifs/cifs_dfs_ref.c +++ b/trunk/fs/cifs/cifs_dfs_ref.c @@ -55,7 +55,7 @@ void cifs_dfs_release_automount_timer(void) * i.e. strips from UNC trailing path that is not part of share * name and fixup missing '\' in the begining of DFS node refferal * if neccessary. - * Returns pointer to share name on success or ERR_PTR on error. + * Returns pointer to share name on success or NULL on error. * Caller is responsible for freeing returned string. */ static char *cifs_get_share_name(const char *node_name) @@ -68,7 +68,7 @@ static char *cifs_get_share_name(const char *node_name) UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */, GFP_KERNEL); if (!UNC) - return ERR_PTR(-ENOMEM); + return NULL; /* get share name and server name */ if (node_name[1] != '\\') { @@ -87,7 +87,7 @@ static char *cifs_get_share_name(const char *node_name) cERROR(1, ("%s: no server name end in node name: %s", __func__, node_name)); kfree(UNC); - return ERR_PTR(-EINVAL); + return NULL; } /* find sharename end */ @@ -133,12 +133,6 @@ char *cifs_compose_mount_options(const char *sb_mountdata, return ERR_PTR(-EINVAL); *devname = cifs_get_share_name(ref->node_name); - if (IS_ERR(*devname)) { - rc = PTR_ERR(*devname); - *devname = NULL; - goto compose_mount_options_err; - } - rc = dns_resolve_server_name_to_ip(*devname, &srvIP); if (rc != 0) { cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d", diff --git a/trunk/fs/cifs/cifs_unicode.c b/trunk/fs/cifs/cifs_unicode.c index 714a542cbafc..60e3c4253de0 100644 --- a/trunk/fs/cifs/cifs_unicode.c +++ b/trunk/fs/cifs/cifs_unicode.c @@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes, int maxwords = maxbytes / 2; char tmp[NLS_MAX_CHARSET_SIZE]; - for (i = 0; i < maxwords && from[i]; i++) { + for (i = 0; from[i] && i < maxwords; i++) { charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp, NLS_MAX_CHARSET_SIZE); if (charlen > 0) diff --git a/trunk/fs/cifs/cifsfs.c b/trunk/fs/cifs/cifsfs.c index 84b75253b05a..44f30504b82d 100644 --- a/trunk/fs/cifs/cifsfs.c +++ b/trunk/fs/cifs/cifsfs.c @@ -376,14 +376,10 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) seq_printf(s, ",forceuid"); - else - seq_printf(s, ",noforceuid"); seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) seq_printf(s, ",forcegid"); - else - seq_printf(s, ",noforcegid"); cifs_show_address(s, tcon->ses->server); diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index 1f3345d7fa79..fc44d316d0bb 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -803,10 +803,6 @@ cifs_parse_mount_options(char *options, const char *devname, char *data; unsigned int temp_len, i, j; char separator[2]; - short int override_uid = -1; - short int override_gid = -1; - bool uid_specified = false; - bool gid_specified = false; separator[0] = ','; separator[1] = 0; @@ -1097,20 +1093,18 @@ cifs_parse_mount_options(char *options, const char *devname, "too long.\n"); return 1; } - } else if (!strnicmp(data, "uid", 3) && value && *value) { - vol->linux_uid = simple_strtoul(value, &value, 0); - uid_specified = true; - } else if (!strnicmp(data, "forceuid", 8)) { - override_uid = 1; - } else if (!strnicmp(data, "noforceuid", 10)) { - override_uid = 0; - } else if (!strnicmp(data, "gid", 3) && value && *value) { - vol->linux_gid = simple_strtoul(value, &value, 0); - gid_specified = true; - } else if (!strnicmp(data, "forcegid", 8)) { - override_gid = 1; - } else if (!strnicmp(data, "noforcegid", 10)) { - override_gid = 0; + } else if (strnicmp(data, "uid", 3) == 0) { + if (value && *value) + vol->linux_uid = + simple_strtoul(value, &value, 0); + } else if (strnicmp(data, "forceuid", 8) == 0) { + vol->override_uid = 1; + } else if (strnicmp(data, "gid", 3) == 0) { + if (value && *value) + vol->linux_gid = + simple_strtoul(value, &value, 0); + } else if (strnicmp(data, "forcegid", 8) == 0) { + vol->override_gid = 1; } else if (strnicmp(data, "file_mode", 4) == 0) { if (value && *value) { vol->file_mode = @@ -1361,18 +1355,6 @@ cifs_parse_mount_options(char *options, const char *devname, if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2]; - if (uid_specified) - vol->override_uid = override_uid; - else if (override_uid == 1) - printk(KERN_NOTICE "CIFS: ignoring forceuid mount option " - "specified with no uid= option.\n"); - - if (gid_specified) - vol->override_gid = override_gid; - else if (override_gid == 1) - printk(KERN_NOTICE "CIFS: ignoring forcegid mount option " - "specified with no gid= option.\n"); - return 0; } @@ -2562,20 +2544,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, if (mount_data != mount_data_global) kfree(mount_data); - mount_data = cifs_compose_mount_options( cifs_sb->mountdata, full_path + 1, referrals, &fake_devname); - - free_dfs_info_array(referrals, num_referrals); kfree(fake_devname); - kfree(full_path); - - if (IS_ERR(mount_data)) { - rc = PTR_ERR(mount_data); - mount_data = NULL; - goto mount_fail_check; - } + free_dfs_info_array(referrals, num_referrals); if (tcon) cifs_put_tcon(tcon); @@ -2583,6 +2556,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, cifs_put_smb_ses(pSesInfo); cleanup_volume_info(&volume_info); + FreeXid(xid); + kfree(full_path); referral_walks_count++; goto try_mount_again; } diff --git a/trunk/fs/nilfs2/mdt.c b/trunk/fs/nilfs2/mdt.c index 2dfd47714ae5..3d3ddb3f5177 100644 --- a/trunk/fs/nilfs2/mdt.c +++ b/trunk/fs/nilfs2/mdt.c @@ -412,10 +412,8 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc) return 0; /* Do not request flush for shadow page cache */ if (!sb) { writer = nilfs_get_writer(NILFS_MDT(inode)->mi_nilfs); - if (!writer) { - nilfs_put_writer(NILFS_MDT(inode)->mi_nilfs); + if (!writer) return -EROFS; - } sb = writer->s_super; } diff --git a/trunk/fs/nilfs2/segment.c b/trunk/fs/nilfs2/segment.c index 51ff3d0a4ee2..8b5e4778cf28 100644 --- a/trunk/fs/nilfs2/segment.c +++ b/trunk/fs/nilfs2/segment.c @@ -1859,26 +1859,12 @@ static void nilfs_end_page_io(struct page *page, int err) if (!page) return; - if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) { + if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) /* * For b-tree node pages, this function may be called twice * or more because they might be split in a segment. */ - if (PageDirty(page)) { - /* - * For pages holding split b-tree node buffers, dirty - * flag on the buffers may be cleared discretely. - * In that case, the page is once redirtied for - * remaining buffers, and it must be cancelled if - * all the buffers get cleaned later. - */ - lock_page(page); - if (nilfs_page_buffers_clean(page)) - __nilfs_clear_page_dirty(page); - unlock_page(page); - } return; - } __nilfs_end_page_io(page, err); }