Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] cifs: fix oops on mount when CONFIG_CIFS_DFS_UPCALL is enabled
[CIFS] Fix hang in mount when negprot causes server to kill tcp session
disable most mode changes on non-unix/non-cifsacl mounts
[CIFS] Correct incorrect obscure open flag
[CIFS] warn if both dynperm and cifsacl mount options specified
silently ignore ownership changes unless unix extensions are enabled or we're faking uid changes
[CIFS] remove trailing whitespace
when creating new inodes, use file_mode/dir_mode exclusively on mount without unix extensions
on non-posix shares, clear write bits in mode when ATTR_READONLY is set
[CIFS] remove unused variables

+171 -129
+5
fs/cifs/CHANGES
··· 2 2 ------------ 3 3 DFS support added (Microsoft Distributed File System client support needed 4 4 for referrals which enable a hierarchical name space among servers). 5 + Disable temporary caching of mode bits to servers which do not support 6 + storing of mode (e.g. Windows servers, when client mounts without cifsacl 7 + mount option) and add new "dynperm" mount option to enable temporary caching 8 + of mode (enable old behavior). Fix hang on mount caused when server crashes 9 + tcp session during negotiate protocol. 5 10 6 11 Version 1.52 7 12 ------------
+10 -11
fs/cifs/cifsfs.c
··· 97 97 { 98 98 struct inode *inode; 99 99 struct cifs_sb_info *cifs_sb; 100 - #ifdef CONFIG_CIFS_DFS_UPCALL 101 - int len; 102 - #endif 103 100 int rc = 0; 104 101 105 102 /* BB should we make this contingent on mount parm? */ ··· 114 117 * complex operation (mount), and in case of fail 115 118 * just exit instead of doing mount and attempting 116 119 * undo it if this copy fails?*/ 117 - len = strlen(data); 118 - cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL); 119 - if (cifs_sb->mountdata == NULL) { 120 - kfree(sb->s_fs_info); 121 - sb->s_fs_info = NULL; 122 - return -ENOMEM; 120 + if (data) { 121 + int len = strlen(data); 122 + cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL); 123 + if (cifs_sb->mountdata == NULL) { 124 + kfree(sb->s_fs_info); 125 + sb->s_fs_info = NULL; 126 + return -ENOMEM; 127 + } 128 + strncpy(cifs_sb->mountdata, data, len + 1); 129 + cifs_sb->mountdata[len] = '\0'; 123 130 } 124 - strncpy(cifs_sb->mountdata, data, len + 1); 125 - cifs_sb->mountdata[len] = '\0'; 126 131 #endif 127 132 128 133 rc = cifs_mount(sb, cifs_sb, data, devname);
+1 -2
fs/cifs/cifsglob.h
··· 333 333 bool messageMode:1; /* for pipes: message vs byte mode */ 334 334 atomic_t wrtPending; /* handle in use - defer close */ 335 335 struct semaphore fh_sem; /* prevents reopen race after dead ses*/ 336 - char *search_resume_name; /* BB removeme BB */ 337 336 struct cifs_search_info srch_inf; 338 337 }; 339 338 ··· 625 626 GLOBAL_EXTERN atomic_t tcpSesReconnectCount; 626 627 GLOBAL_EXTERN atomic_t tconInfoReconnectCount; 627 628 628 - /* Various Debug counters to remove someday (BB) */ 629 + /* Various Debug counters */ 629 630 GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */ 630 631 #ifdef CONFIG_CIFS_STATS2 631 632 GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */
+18 -5
fs/cifs/cifspdu.h
··· 79 79 #define TRANS2_GET_DFS_REFERRAL 0x10 80 80 #define TRANS2_REPORT_DFS_INCOSISTENCY 0x11 81 81 82 + /* SMB Transact (Named Pipe) subcommand codes */ 83 + #define TRANS_SET_NMPIPE_STATE 0x0001 84 + #define TRANS_RAW_READ_NMPIPE 0x0011 85 + #define TRANS_QUERY_NMPIPE_STATE 0x0021 86 + #define TRANS_QUERY_NMPIPE_INFO 0x0022 87 + #define TRANS_PEEK_NMPIPE 0x0023 88 + #define TRANS_TRANSACT_NMPIPE 0x0026 89 + #define TRANS_RAW_WRITE_NMPIPE 0x0031 90 + #define TRANS_READ_NMPIPE 0x0036 91 + #define TRANS_WRITE_NMPIPE 0x0037 92 + #define TRANS_WAIT_NMPIPE 0x0053 93 + #define TRANS_CALL_NMPIPE 0x0054 94 + 82 95 /* NT Transact subcommand codes */ 83 96 #define NT_TRANSACT_CREATE 0x01 84 97 #define NT_TRANSACT_IOCTL 0x02 ··· 341 328 #define CREATE_COMPLETE_IF_OPLK 0x00000100 /* should be zero */ 342 329 #define CREATE_NO_EA_KNOWLEDGE 0x00000200 343 330 #define CREATE_EIGHT_DOT_THREE 0x00000400 /* doc says this is obsolete 344 - open for recovery flag - should 345 - be zero */ 331 + "open for recovery" flag - should 332 + be zero in any case */ 333 + #define CREATE_OPEN_FOR_RECOVERY 0x00000400 346 334 #define CREATE_RANDOM_ACCESS 0x00000800 347 335 #define CREATE_DELETE_ON_CLOSE 0x00001000 348 336 #define CREATE_OPEN_BY_ID 0x00002000 349 - #define CREATE_OPEN_BACKUP_INTN 0x00004000 337 + #define CREATE_OPEN_BACKUP_INTENT 0x00004000 350 338 #define CREATE_NO_COMPRESSION 0x00008000 351 339 #define CREATE_RESERVE_OPFILTER 0x00100000 /* should be zero */ 352 340 #define OPEN_REPARSE_POINT 0x00200000 ··· 736 722 #define SMB_CSC_CACHE_AUTO_REINT 0x0004 737 723 #define SMB_CSC_CACHE_VDO 0x0008 738 724 #define SMB_CSC_NO_CACHING 0x000C 739 - 740 725 #define SMB_UNIQUE_FILE_NAME 0x0010 741 726 #define SMB_EXTENDED_SIGNATURES 0x0020 742 727 ··· 819 806 #define ICOUNT_MASK 0x00FF 820 807 #define PIPE_READ_MODE 0x0100 821 808 #define NAMED_PIPE_TYPE 0x0400 822 - #define PIPE_END_POINT 0x0800 809 + #define PIPE_END_POINT 0x4000 823 810 #define BLOCKING_NAMED_PIPE 0x8000 824 811 825 812 typedef struct smb_com_open_req { /* also handles create */
+2 -4
fs/cifs/cifssmb.c
··· 1728 1728 { 1729 1729 int rc = 0; 1730 1730 LOCK_REQ *pSMB = NULL; 1731 - LOCK_RSP *pSMBr = NULL; 1731 + /* LOCK_RSP *pSMBr = NULL; */ /* No response data other than rc to parse */ 1732 1732 int bytes_returned; 1733 1733 int timeout = 0; 1734 1734 __u16 count; ··· 1738 1738 1739 1739 if (rc) 1740 1740 return rc; 1741 - 1742 - pSMBr = (LOCK_RSP *)pSMB; /* BB removeme BB */ 1743 1741 1744 1742 if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) { 1745 1743 timeout = CIFS_ASYNC_OP; /* no response expected */ ··· 1772 1774 1773 1775 if (waitFlag) { 1774 1776 rc = SendReceiveBlockingLock(xid, tcon, (struct smb_hdr *) pSMB, 1775 - (struct smb_hdr *) pSMBr, &bytes_returned); 1777 + (struct smb_hdr *) pSMB, &bytes_returned); 1776 1778 cifs_small_buf_release(pSMB); 1777 1779 } else { 1778 1780 rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *)pSMB,
+5
fs/cifs/connect.c
··· 653 653 spin_lock(&GlobalMid_Lock); 654 654 server->tcpStatus = CifsExiting; 655 655 spin_unlock(&GlobalMid_Lock); 656 + wake_up_all(&server->response_q); 656 657 657 658 /* don't exit until kthread_stop is called */ 658 659 set_current_state(TASK_UNINTERRUPTIBLE); ··· 2120 2119 cFYI(1, ("mounting share using direct i/o")); 2121 2120 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; 2122 2121 } 2122 + 2123 + if ((volume_info.cifs_acl) && (volume_info.dynperm)) 2124 + cERROR(1, ("mount option dynperm ignored if cifsacl " 2125 + "mount option supported")); 2123 2126 2124 2127 tcon = 2125 2128 find_unc(sin_server.sin_addr.s_addr, volume_info.UNC,
+3 -1
fs/cifs/dir.c
··· 260 260 buf, inode->i_sb, xid, 261 261 &fileHandle); 262 262 if (newinode) { 263 - newinode->i_mode = mode; 263 + if (cifs_sb->mnt_cifs_flags & 264 + CIFS_MOUNT_DYNPERM) 265 + newinode->i_mode = mode; 264 266 if ((oplock & CIFS_CREATE_ACTION) && 265 267 (cifs_sb->mnt_cifs_flags & 266 268 CIFS_MOUNT_SET_UID)) {
-7
fs/cifs/file.c
··· 546 546 msleep(timeout); 547 547 timeout *= 8; 548 548 } 549 - kfree(pSMBFile->search_resume_name); 550 549 kfree(file->private_data); 551 550 file->private_data = NULL; 552 551 } else ··· 603 604 cifs_small_buf_release(ptmp); 604 605 else 605 606 cifs_buf_release(ptmp); 606 - } 607 - ptmp = pCFileStruct->search_resume_name; 608 - if (ptmp) { 609 - cFYI(1, ("closedir free resume name")); 610 - pCFileStruct->search_resume_name = NULL; 611 - kfree(ptmp); 612 607 } 613 608 kfree(file->private_data); 614 609 file->private_data = NULL;
+86 -60
fs/cifs/inode.c
··· 418 418 char *buf = NULL; 419 419 bool adjustTZ = false; 420 420 bool is_dfs_referral = false; 421 + umode_t default_mode; 421 422 422 423 pTcon = cifs_sb->tcon; 423 424 cFYI(1, ("Getting info on %s", full_path)); ··· 531 530 inode->i_mtime.tv_sec += pTcon->ses->server->timeAdj; 532 531 } 533 532 534 - /* set default mode. will override for dirs below */ 535 - if (atomic_read(&cifsInfo->inUse) == 0) 536 - /* new inode, can safely set these fields */ 537 - inode->i_mode = cifs_sb->mnt_file_mode; 538 - else /* since we set the inode type below we need to mask off 539 - to avoid strange results if type changes and both 540 - get orred in */ 541 - inode->i_mode &= ~S_IFMT; 542 - /* if (attr & ATTR_REPARSE) */ 543 - /* We no longer handle these as symlinks because we could not 544 - follow them due to the absolute path with drive letter */ 545 - if (attr & ATTR_DIRECTORY) { 546 - /* override default perms since we do not do byte range locking 547 - on dirs */ 548 - inode->i_mode = cifs_sb->mnt_dir_mode; 549 - inode->i_mode |= S_IFDIR; 550 - } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && 551 - (cifsInfo->cifsAttrs & ATTR_SYSTEM) && 552 - /* No need to le64 convert size of zero */ 553 - (pfindData->EndOfFile == 0)) { 554 - inode->i_mode = cifs_sb->mnt_file_mode; 555 - inode->i_mode |= S_IFIFO; 556 - /* BB Finish for SFU style symlinks and devices */ 557 - } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && 558 - (cifsInfo->cifsAttrs & ATTR_SYSTEM)) { 559 - if (decode_sfu_inode(inode, le64_to_cpu(pfindData->EndOfFile), 560 - full_path, cifs_sb, xid)) 561 - cFYI(1, ("Unrecognized sfu inode type")); 533 + /* get default inode mode */ 534 + if (attr & ATTR_DIRECTORY) 535 + default_mode = cifs_sb->mnt_dir_mode; 536 + else 537 + default_mode = cifs_sb->mnt_file_mode; 562 538 563 - cFYI(1, ("sfu mode 0%o", inode->i_mode)); 539 + /* set permission bits */ 540 + if (atomic_read(&cifsInfo->inUse) == 0 || 541 + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0) 542 + inode->i_mode = default_mode; 543 + else { 544 + /* just reenable write bits if !ATTR_READONLY */ 545 + if ((inode->i_mode & S_IWUGO) == 0 && 546 + (attr & ATTR_READONLY) == 0) 547 + inode->i_mode |= (S_IWUGO & default_mode); 548 + inode->i_mode &= ~S_IFMT; 549 + } 550 + /* clear write bits if ATTR_READONLY is set */ 551 + if (attr & ATTR_READONLY) 552 + inode->i_mode &= ~S_IWUGO; 553 + 554 + /* set inode type */ 555 + if ((attr & ATTR_SYSTEM) && 556 + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) { 557 + /* no need to fix endianness on 0 */ 558 + if (pfindData->EndOfFile == 0) 559 + inode->i_mode |= S_IFIFO; 560 + else if (decode_sfu_inode(inode, 561 + le64_to_cpu(pfindData->EndOfFile), 562 + full_path, cifs_sb, xid)) 563 + cFYI(1, ("unknown SFU file type\n")); 564 564 } else { 565 - inode->i_mode |= S_IFREG; 566 - /* treat dos attribute of read-only as read-only mode eg 555 */ 567 - if (cifsInfo->cifsAttrs & ATTR_READONLY) 568 - inode->i_mode &= ~(S_IWUGO); 569 - else if ((inode->i_mode & S_IWUGO) == 0) 570 - /* the ATTR_READONLY flag may have been */ 571 - /* changed on server -- set any w bits */ 572 - /* allowed by mnt_file_mode */ 573 - inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode); 574 - /* BB add code to validate if device or weird share or device type? */ 565 + if (attr & ATTR_DIRECTORY) 566 + inode->i_mode |= S_IFDIR; 567 + else 568 + inode->i_mode |= S_IFREG; 575 569 } 576 570 577 571 spin_lock(&inode->i_lock); ··· 1015 1019 CIFS_MOUNT_MAP_SPECIAL_CHR); 1016 1020 } 1017 1021 if (direntry->d_inode) { 1018 - direntry->d_inode->i_mode = mode; 1019 - direntry->d_inode->i_mode |= S_IFDIR; 1022 + if (cifs_sb->mnt_cifs_flags & 1023 + CIFS_MOUNT_DYNPERM) 1024 + direntry->d_inode->i_mode = 1025 + (mode | S_IFDIR); 1026 + 1020 1027 if (cifs_sb->mnt_cifs_flags & 1021 1028 CIFS_MOUNT_SET_UID) { 1022 1029 direntry->d_inode->i_uid = ··· 1546 1547 } else 1547 1548 goto cifs_setattr_exit; 1548 1549 } 1549 - if (attrs->ia_valid & ATTR_UID) { 1550 - cFYI(1, ("UID changed to %d", attrs->ia_uid)); 1551 - uid = attrs->ia_uid; 1552 - } 1553 - if (attrs->ia_valid & ATTR_GID) { 1554 - cFYI(1, ("GID changed to %d", attrs->ia_gid)); 1555 - gid = attrs->ia_gid; 1550 + 1551 + /* 1552 + * Without unix extensions we can't send ownership changes to the 1553 + * server, so silently ignore them. This is consistent with how 1554 + * local DOS/Windows filesystems behave (VFAT, NTFS, etc). With 1555 + * CIFSACL support + proper Windows to Unix idmapping, we may be 1556 + * able to support this in the future. 1557 + */ 1558 + if (!pTcon->unix_ext && 1559 + !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)) { 1560 + attrs->ia_valid &= ~(ATTR_UID | ATTR_GID); 1561 + } else { 1562 + if (attrs->ia_valid & ATTR_UID) { 1563 + cFYI(1, ("UID changed to %d", attrs->ia_uid)); 1564 + uid = attrs->ia_uid; 1565 + } 1566 + if (attrs->ia_valid & ATTR_GID) { 1567 + cFYI(1, ("GID changed to %d", attrs->ia_gid)); 1568 + gid = attrs->ia_gid; 1569 + } 1556 1570 } 1557 1571 1558 1572 time_buf.Attributes = 0; ··· 1575 1563 attrs->ia_valid &= ~ATTR_MODE; 1576 1564 1577 1565 if (attrs->ia_valid & ATTR_MODE) { 1578 - cFYI(1, ("Mode changed to 0x%x", attrs->ia_mode)); 1566 + cFYI(1, ("Mode changed to 0%o", attrs->ia_mode)); 1579 1567 mode = attrs->ia_mode; 1580 1568 } 1581 1569 ··· 1590 1578 #ifdef CONFIG_CIFS_EXPERIMENTAL 1591 1579 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) 1592 1580 rc = mode_to_acl(inode, full_path, mode); 1593 - else if ((mode & S_IWUGO) == 0) { 1594 - #else 1595 - if ((mode & S_IWUGO) == 0) { 1581 + else 1596 1582 #endif 1597 - /* not writeable */ 1598 - if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) { 1599 - set_dosattr = true; 1600 - time_buf.Attributes = 1601 - cpu_to_le32(cifsInode->cifsAttrs | 1602 - ATTR_READONLY); 1603 - } 1604 - } else if (cifsInode->cifsAttrs & ATTR_READONLY) { 1583 + if (((mode & S_IWUGO) == 0) && 1584 + (cifsInode->cifsAttrs & ATTR_READONLY) == 0) { 1585 + set_dosattr = true; 1586 + time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs | 1587 + ATTR_READONLY); 1588 + /* fix up mode if we're not using dynperm */ 1589 + if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0) 1590 + attrs->ia_mode = inode->i_mode & ~S_IWUGO; 1591 + } else if ((mode & S_IWUGO) && 1592 + (cifsInode->cifsAttrs & ATTR_READONLY)) { 1605 1593 /* If file is readonly on server, we would 1606 1594 not be able to write to it - so if any write 1607 1595 bit is enabled for user or group or other we ··· 1612 1600 /* Windows ignores set to zero */ 1613 1601 if (time_buf.Attributes == 0) 1614 1602 time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL); 1603 + 1604 + /* reset local inode permissions to normal */ 1605 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)) { 1606 + attrs->ia_mode &= ~(S_IALLUGO); 1607 + if (S_ISDIR(inode->i_mode)) 1608 + attrs->ia_mode |= 1609 + cifs_sb->mnt_dir_mode; 1610 + else 1611 + attrs->ia_mode |= 1612 + cifs_sb->mnt_file_mode; 1613 + } 1614 + } else if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)) { 1615 + /* ignore mode change - ATTR_READONLY hasn't changed */ 1616 + attrs->ia_valid &= ~ATTR_MODE; 1615 1617 } 1616 1618 } 1617 1619
+1 -2
fs/cifs/misc.c
··· 519 519 pnotify = (struct file_notify_information *) 520 520 ((char *)&pSMBr->hdr.Protocol + data_offset); 521 521 cFYI(1, ("dnotify on %s Action: 0x%x", 522 - pnotify->FileName, 523 - pnotify->Action)); /* BB removeme BB */ 522 + pnotify->FileName, pnotify->Action)); 524 523 /* cifs_dump_mem("Rcvd notify Data: ",buf, 525 524 sizeof(struct smb_hdr)+60); */ 526 525 return true;
+40 -37
fs/cifs/readdir.c
··· 132 132 __u32 attr; 133 133 __u64 allocation_size; 134 134 __u64 end_of_file; 135 + umode_t default_mode; 135 136 136 137 /* save mtime and size */ 137 138 local_mtime = tmp_inode->i_mtime; ··· 188 187 if (atomic_read(&cifsInfo->inUse) == 0) { 189 188 tmp_inode->i_uid = cifs_sb->mnt_uid; 190 189 tmp_inode->i_gid = cifs_sb->mnt_gid; 191 - /* set default mode. will override for dirs below */ 192 - tmp_inode->i_mode = cifs_sb->mnt_file_mode; 193 - } else { 194 - /* mask off the type bits since it gets set 195 - below and we do not want to get two type 196 - bits set */ 190 + } 191 + 192 + if (attr & ATTR_DIRECTORY) 193 + default_mode = cifs_sb->mnt_dir_mode; 194 + else 195 + default_mode = cifs_sb->mnt_file_mode; 196 + 197 + /* set initial permissions */ 198 + if ((atomic_read(&cifsInfo->inUse) == 0) || 199 + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) == 0) 200 + tmp_inode->i_mode = default_mode; 201 + else { 202 + /* just reenable write bits if !ATTR_READONLY */ 203 + if ((tmp_inode->i_mode & S_IWUGO) == 0 && 204 + (attr & ATTR_READONLY) == 0) 205 + tmp_inode->i_mode |= (S_IWUGO & default_mode); 206 + 197 207 tmp_inode->i_mode &= ~S_IFMT; 198 208 } 199 209 200 - if (attr & ATTR_DIRECTORY) { 201 - *pobject_type = DT_DIR; 202 - /* override default perms since we do not lock dirs */ 203 - if (atomic_read(&cifsInfo->inUse) == 0) 204 - tmp_inode->i_mode = cifs_sb->mnt_dir_mode; 205 - tmp_inode->i_mode |= S_IFDIR; 206 - } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && 207 - (attr & ATTR_SYSTEM)) { 210 + /* clear write bits if ATTR_READONLY is set */ 211 + if (attr & ATTR_READONLY) 212 + tmp_inode->i_mode &= ~S_IWUGO; 213 + 214 + /* set inode type */ 215 + if ((attr & ATTR_SYSTEM) && 216 + (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL)) { 208 217 if (end_of_file == 0) { 209 - *pobject_type = DT_FIFO; 210 218 tmp_inode->i_mode |= S_IFIFO; 219 + *pobject_type = DT_FIFO; 211 220 } else { 212 - /* rather than get the type here, we mark the 213 - inode as needing revalidate and get the real type 214 - (blk vs chr vs. symlink) later ie in lookup */ 215 - *pobject_type = DT_REG; 221 + /* 222 + * trying to get the type can be slow, so just call 223 + * this a regular file for now, and mark for reval 224 + */ 216 225 tmp_inode->i_mode |= S_IFREG; 226 + *pobject_type = DT_REG; 217 227 cifsInfo->time = 0; 218 228 } 219 - /* we no longer mark these because we could not follow them */ 220 - /* } else if (attr & ATTR_REPARSE) { 221 - *pobject_type = DT_LNK; 222 - tmp_inode->i_mode |= S_IFLNK; */ 223 229 } else { 224 - *pobject_type = DT_REG; 225 - tmp_inode->i_mode |= S_IFREG; 226 - if (attr & ATTR_READONLY) 227 - tmp_inode->i_mode &= ~(S_IWUGO); 228 - else if ((tmp_inode->i_mode & S_IWUGO) == 0) 229 - /* the ATTR_READONLY flag may have been changed on */ 230 - /* server -- set any w bits allowed by mnt_file_mode */ 231 - tmp_inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode); 232 - } /* could add code here - to validate if device or weird share type? */ 230 + if (attr & ATTR_DIRECTORY) { 231 + tmp_inode->i_mode |= S_IFDIR; 232 + *pobject_type = DT_DIR; 233 + } else { 234 + tmp_inode->i_mode |= S_IFREG; 235 + *pobject_type = DT_REG; 236 + } 237 + } 233 238 234 239 /* can not fill in nlink here as in qpathinfo version and Unx search */ 235 240 if (atomic_read(&cifsInfo->inUse) == 0) ··· 682 675 cifsFile->invalidHandle = true; 683 676 CIFSFindClose(xid, pTcon, cifsFile->netfid); 684 677 } 685 - kfree(cifsFile->search_resume_name); 686 - cifsFile->search_resume_name = NULL; 687 678 if (cifsFile->srch_inf.ntwrk_buf_start) { 688 679 cFYI(1, ("freeing SMB ff cache buf on search rewind")); 689 680 if (cifsFile->srch_inf.smallBuf) ··· 1048 1043 } /* else { 1049 1044 cifsFile->invalidHandle = true; 1050 1045 CIFSFindClose(xid, pTcon, cifsFile->netfid); 1051 - } 1052 - kfree(cifsFile->search_resume_name); 1053 - cifsFile->search_resume_name = NULL; */ 1046 + } */ 1054 1047 1055 1048 rc = find_cifs_entry(xid, pTcon, file, 1056 1049 &current_entry, &num_to_fill);