Skip to content

Commit 89db69d

Browse files
committed
Merge tag 'smb3-file-name-too-long-fix' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fix from Steve French: "smb3 file name too long fix" * tag 'smb3-file-name-too-long-fix' of git://git.samba.org/sfrench/cifs-2.6: cifs: check MaxPathNameComponentLength != 0 before using it
2 parents 7c404c6 + f74bc7c commit 89db69d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

fs/cifs/dir.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ check_name(struct dentry *direntry, struct cifs_tcon *tcon)
204204
struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb);
205205
int i;
206206

207-
if (unlikely(direntry->d_name.len >
207+
if (unlikely(tcon->fsAttrInfo.MaxPathNameComponentLength &&
208+
direntry->d_name.len >
208209
le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength)))
209210
return -ENAMETOOLONG;
210211

@@ -520,7 +521,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
520521

521522
rc = check_name(direntry, tcon);
522523
if (rc)
523-
goto out_free_xid;
524+
goto out;
524525

525526
server = tcon->ses->server;
526527

0 commit comments

Comments
 (0)