Skip to content

Commit c6de168

Browse files
committed
Merge git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French. * git://git.samba.org/sfrench/cifs-2.6: fs/cifs: fix parsing of dfs referrals cifs: make sure we ignore the credentials= and cred= options [CIFS] Update cifs version to 1.78 cifs - check S_AUTOMOUNT in revalidate cifs: add missing initialization of server->req_lock cifs: don't cap ra_pages at the same level as default_backing_dev_info CIFS: Fix indentation in cifs_show_options
2 parents a03a09b + d8f2799 commit c6de168

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

fs/cifs/cifsfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
442442
seq_printf(s, ",rsize=%u", cifs_sb->rsize);
443443
seq_printf(s, ",wsize=%u", cifs_sb->wsize);
444444
/* convert actimeo and display it in seconds */
445-
seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ);
445+
seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ);
446446

447447
return 0;
448448
}

fs/cifs/cifsfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
125125
extern const struct export_operations cifs_export_ops;
126126
#endif /* CONFIG_CIFS_NFSD_EXPORT */
127127

128-
#define CIFS_VERSION "1.77"
128+
#define CIFS_VERSION "1.78"
129129
#endif /* _CIFSFS_H */

fs/cifs/cifssmb.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4844,8 +4844,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
48444844
max_len = data_end - temp;
48454845
node->node_name = cifs_strndup_from_utf16(temp, max_len,
48464846
is_unicode, nls_codepage);
4847-
if (!node->node_name)
4847+
if (!node->node_name) {
48484848
rc = -ENOMEM;
4849+
goto parse_DFS_referrals_exit;
4850+
}
4851+
4852+
ref++;
48494853
}
48504854

48514855
parse_DFS_referrals_exit:

fs/cifs/connect.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ static const match_table_t cifs_mount_option_tokens = {
215215

216216
{ Opt_ignore, "cred" },
217217
{ Opt_ignore, "credentials" },
218+
{ Opt_ignore, "cred=%s" },
219+
{ Opt_ignore, "credentials=%s" },
218220
{ Opt_ignore, "guest" },
219221
{ Opt_ignore, "rw" },
220222
{ Opt_ignore, "ro" },
@@ -2183,6 +2185,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
21832185
tcp_ses->session_estab = false;
21842186
tcp_ses->sequence_number = 0;
21852187
tcp_ses->lstrp = jiffies;
2188+
spin_lock_init(&tcp_ses->req_lock);
21862189
INIT_LIST_HEAD(&tcp_ses->tcp_ses_list);
21872190
INIT_LIST_HEAD(&tcp_ses->smb_ses_list);
21882191
INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request);
@@ -3614,22 +3617,6 @@ cifs_get_volume_info(char *mount_data, const char *devname)
36143617
return volume_info;
36153618
}
36163619

3617-
/* make sure ra_pages is a multiple of rsize */
3618-
static inline unsigned int
3619-
cifs_ra_pages(struct cifs_sb_info *cifs_sb)
3620-
{
3621-
unsigned int reads;
3622-
unsigned int rsize_pages = cifs_sb->rsize / PAGE_CACHE_SIZE;
3623-
3624-
if (rsize_pages >= default_backing_dev_info.ra_pages)
3625-
return default_backing_dev_info.ra_pages;
3626-
else if (rsize_pages == 0)
3627-
return rsize_pages;
3628-
3629-
reads = default_backing_dev_info.ra_pages / rsize_pages;
3630-
return reads * rsize_pages;
3631-
}
3632-
36333620
int
36343621
cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
36353622
{
@@ -3717,7 +3704,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
37173704
cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info);
37183705

37193706
/* tune readahead according to rsize */
3720-
cifs_sb->bdi.ra_pages = cifs_ra_pages(cifs_sb);
3707+
cifs_sb->bdi.ra_pages = cifs_sb->rsize / PAGE_CACHE_SIZE;
37213708

37223709
remote_path_check:
37233710
#ifdef CONFIG_CIFS_DFS_UPCALL

fs/cifs/dir.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,12 +668,19 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
668668
return 0;
669669
else {
670670
/*
671-
* Forcibly invalidate automounting directory inodes
672-
* (remote DFS directories) so to have them
673-
* instantiated again for automount
671+
* If the inode wasn't known to be a dfs entry when
672+
* the dentry was instantiated, such as when created
673+
* via ->readdir(), it needs to be set now since the
674+
* attributes will have been updated by
675+
* cifs_revalidate_dentry().
674676
*/
675-
if (IS_AUTOMOUNT(direntry->d_inode))
676-
return 0;
677+
if (IS_AUTOMOUNT(direntry->d_inode) &&
678+
!(direntry->d_flags & DCACHE_NEED_AUTOMOUNT)) {
679+
spin_lock(&direntry->d_lock);
680+
direntry->d_flags |= DCACHE_NEED_AUTOMOUNT;
681+
spin_unlock(&direntry->d_lock);
682+
}
683+
677684
return 1;
678685
}
679686
}

0 commit comments

Comments
 (0)