Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  cifs: when renaming don't try to unlink negative dentry
  cifs: remove unneeded bcc_ptr update in CIFSTCon
  cifs: add cFYI messages with some of the saved strings from ssetup/tcon
  cifs: fix buffer size for tcon->nativeFileSystem field
  cifs: fix unicode string area word alignment in session setup
  [CIFS] Fix build break caused by change to new current_umask helper function
  [CIFS] Fix sparse warnings
  [CIFS] Add support for posix open during lookup
  cifs: no need to use rcu_assign_pointer on immutable keys
  cifs: remove dnotify thread code
  [CIFS] remove some build warnings
  cifs: vary timeout on writes past EOF based on offset (try #5)
  [CIFS] Fix build break from recent DFS patch when DFS support not enabled
  Remote DFS root support.
  [CIFS] Endian convert UniqueId when reporting inode numbers from server files
  cifs: remove some pointless conditionals before kfree()
  cifs: flush data on any setattr
  • Loading branch information
Linus Torvalds committed Apr 19, 2009
2 parents df89f1b + fc6f394 commit 8d4ab5d
Show file tree
Hide file tree
Showing 13 changed files with 407 additions and 272 deletions.
3 changes: 2 additions & 1 deletion fs/cifs/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Posix file open support added (turned off after one attempt if server
fails to support it properly, as with Samba server versions prior to 3.3.2)
Fix "redzone overwritten" bug in cifs_put_tcon (CIFSTcon may allocate too
little memory for the "nativeFileSystem" field returned by the server
during mount).
during mount). Endian convert inode numbers if necessary (makes it easier
to compare inode numbers on network files from big endian systems).

Version 1.56
------------
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifs_spnego.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cifs_spnego_key_instantiate(struct key *key, const void *data, size_t datalen)

/* attach the data */
memcpy(payload, data, datalen);
rcu_assign_pointer(key->payload.data, payload);
key->payload.data = payload;
ret = 0;

error:
Expand Down
48 changes: 1 addition & 47 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ unsigned int sign_CIFS_PDUs = 1;
extern struct task_struct *oplockThread; /* remove sparse warning */
struct task_struct *oplockThread = NULL;
/* extern struct task_struct * dnotifyThread; remove sparse warning */
#ifdef CONFIG_CIFS_EXPERIMENTAL
static struct task_struct *dnotifyThread = NULL;
#endif
static const struct super_operations cifs_super_ops;
unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
module_param(CIFSMaxBufSize, int, 0);
Expand Down Expand Up @@ -316,6 +313,7 @@ cifs_alloc_inode(struct super_block *sb)
cifs_inode->clientCanCacheAll = false;
cifs_inode->delete_pending = false;
cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
cifs_inode->server_eof = 0;

/* Can not set i_flags here - they get immediately overwritten
to zero by the VFS */
Expand Down Expand Up @@ -1040,34 +1038,6 @@ static int cifs_oplock_thread(void *dummyarg)
return 0;
}

#ifdef CONFIG_CIFS_EXPERIMENTAL
static int cifs_dnotify_thread(void *dummyarg)
{
struct list_head *tmp;
struct TCP_Server_Info *server;

do {
if (try_to_freeze())
continue;
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(15*HZ);
/* check if any stuck requests that need
to be woken up and wakeq so the
thread can wake up and error out */
read_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &cifs_tcp_ses_list) {
server = list_entry(tmp, struct TCP_Server_Info,
tcp_ses_list);
if (atomic_read(&server->inFlight))
wake_up_all(&server->response_q);
}
read_unlock(&cifs_tcp_ses_lock);
} while (!kthread_should_stop());

return 0;
}
#endif

static int __init
init_cifs(void)
{
Expand Down Expand Up @@ -1144,21 +1114,8 @@ init_cifs(void)
goto out_unregister_dfs_key_type;
}

#ifdef CONFIG_CIFS_EXPERIMENTAL
dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
if (IS_ERR(dnotifyThread)) {
rc = PTR_ERR(dnotifyThread);
cERROR(1, ("error %d create dnotify thread", rc));
goto out_stop_oplock_thread;
}
#endif

return 0;

#ifdef CONFIG_CIFS_EXPERIMENTAL
out_stop_oplock_thread:
#endif
kthread_stop(oplockThread);
out_unregister_dfs_key_type:
#ifdef CONFIG_CIFS_DFS_UPCALL
unregister_key_type(&key_type_dns_resolver);
Expand Down Expand Up @@ -1196,9 +1153,6 @@ exit_cifs(void)
cifs_destroy_inodecache();
cifs_destroy_mids();
cifs_destroy_request_bufs();
#ifdef CONFIG_CIFS_EXPERIMENTAL
kthread_stop(dnotifyThread);
#endif
kthread_stop(oplockThread);
}

Expand Down
3 changes: 2 additions & 1 deletion fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ struct cifsFileInfo {
bool invalidHandle:1; /* file closed via session abend */
bool messageMode:1; /* for pipes: message vs byte mode */
atomic_t wrtPending; /* handle in use - defer close */
struct semaphore fh_sem; /* prevents reopen race after dead ses*/
struct mutex fh_mutex; /* prevents reopen race after dead ses*/
struct cifs_search_info srch_inf;
};

Expand All @@ -370,6 +370,7 @@ struct cifsInodeInfo {
bool clientCanCacheAll:1; /* read and writebehind oplock */
bool oplockPending:1;
bool delete_pending:1; /* DELETE_ON_CLOSE is set */
u64 server_eof; /* current file size on server */
struct inode vfs_inode;
};

Expand Down
8 changes: 4 additions & 4 deletions fs/cifs/cifspdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ typedef struct {
__le32 Type;
__le64 DevMajor;
__le64 DevMinor;
__u64 UniqueId;
__le64 UniqueId;
__le64 Permissions;
__le64 Nlinks;
} __attribute__((packed)) FILE_UNIX_BASIC_INFO; /* level 0x200 QPathInfo */
Expand Down Expand Up @@ -2308,7 +2308,7 @@ struct unlink_psx_rq { /* level 0x20a SetPathInfo */
} __attribute__((packed));

struct file_internal_info {
__u64 UniqueId; /* inode number */
__le64 UniqueId; /* inode number */
} __attribute__((packed)); /* level 0x3ee */

struct file_mode_info {
Expand Down Expand Up @@ -2338,7 +2338,7 @@ typedef struct {
__le32 Type;
__le64 DevMajor;
__le64 DevMinor;
__u64 UniqueId;
__le64 UniqueId;
__le64 Permissions;
__le64 Nlinks;
char FileName[1];
Expand Down Expand Up @@ -2386,7 +2386,7 @@ typedef struct {
__le32 FileNameLength;
__le32 EaSize; /* EA size */
__le32 Reserved;
__u64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/
__le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/
char FileName[1];
} __attribute__((packed)) SEARCH_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */

Expand Down
6 changes: 3 additions & 3 deletions fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,8 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
int smb_hdr_len;
int resp_buf_type = 0;

*nbytes = 0;

cFYI(1, ("write2 at %lld %d bytes", (long long)offset, count));

if (tcon->ses->capabilities & CAP_LARGE_FILES) {
Expand Down Expand Up @@ -1682,11 +1684,9 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
cifs_stats_inc(&tcon->num_writes);
if (rc) {
cFYI(1, ("Send error Write2 = %d", rc));
*nbytes = 0;
} else if (resp_buf_type == 0) {
/* presumably this can not happen, but best to be safe */
rc = -EIO;
*nbytes = 0;
} else {
WRITE_RSP *pSMBr = (WRITE_RSP *)iov[0].iov_base;
*nbytes = le16_to_cpu(pSMBr->CountHigh);
Expand Down Expand Up @@ -3918,7 +3918,7 @@ CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
}
pfinfo = (struct file_internal_info *)
(data_offset + (char *) &pSMBr->hdr.Protocol);
*inode_number = pfinfo->UniqueId;
*inode_number = le64_to_cpu(pfinfo->UniqueId);
}
}
GetInodeNumOut:
Expand Down
Loading

0 comments on commit 8d4ab5d

Please sign in to comment.