diff options
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 72d448bf96c..d7eeb9d3ed6 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -171,7 +171,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
171 | } | 171 | } |
172 | tcon = tlink_tcon(tlink); | 172 | tcon = tlink_tcon(tlink); |
173 | 173 | ||
174 | if (oplockEnabled) | 174 | if (enable_oplocks) |
175 | oplock = REQ_OPLOCK; | 175 | oplock = REQ_OPLOCK; |
176 | 176 | ||
177 | if (nd) | 177 | if (nd) |
@@ -244,6 +244,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
244 | if (!tcon->unix_ext && (mode & S_IWUGO) == 0) | 244 | if (!tcon->unix_ext && (mode & S_IWUGO) == 0) |
245 | create_options |= CREATE_OPTION_READONLY; | 245 | create_options |= CREATE_OPTION_READONLY; |
246 | 246 | ||
247 | if (backup_cred(cifs_sb)) | ||
248 | create_options |= CREATE_OPEN_BACKUP_INTENT; | ||
249 | |||
247 | if (tcon->ses->capabilities & CAP_NT_SMBS) | 250 | if (tcon->ses->capabilities & CAP_NT_SMBS) |
248 | rc = CIFSSMBOpen(xid, tcon, full_path, disposition, | 251 | rc = CIFSSMBOpen(xid, tcon, full_path, disposition, |
249 | desiredAccess, create_options, | 252 | desiredAccess, create_options, |
@@ -357,6 +360,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
357 | { | 360 | { |
358 | int rc = -EPERM; | 361 | int rc = -EPERM; |
359 | int xid; | 362 | int xid; |
363 | int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL; | ||
360 | struct cifs_sb_info *cifs_sb; | 364 | struct cifs_sb_info *cifs_sb; |
361 | struct tcon_link *tlink; | 365 | struct tcon_link *tlink; |
362 | struct cifs_tcon *pTcon; | 366 | struct cifs_tcon *pTcon; |
@@ -431,9 +435,11 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
431 | return rc; | 435 | return rc; |
432 | } | 436 | } |
433 | 437 | ||
434 | /* FIXME: would WRITE_OWNER | WRITE_DAC be better? */ | 438 | if (backup_cred(cifs_sb)) |
439 | create_options |= CREATE_OPEN_BACKUP_INTENT; | ||
440 | |||
435 | rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_CREATE, | 441 | rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_CREATE, |
436 | GENERIC_WRITE, CREATE_NOT_DIR | CREATE_OPTION_SPECIAL, | 442 | GENERIC_WRITE, create_options, |
437 | &fileHandle, &oplock, buf, cifs_sb->local_nls, | 443 | &fileHandle, &oplock, buf, cifs_sb->local_nls, |
438 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 444 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
439 | if (rc) | 445 | if (rc) |
@@ -642,8 +648,16 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) | |||
642 | if (direntry->d_inode) { | 648 | if (direntry->d_inode) { |
643 | if (cifs_revalidate_dentry(direntry)) | 649 | if (cifs_revalidate_dentry(direntry)) |
644 | return 0; | 650 | return 0; |
645 | else | 651 | else { |
652 | /* | ||
653 | * Forcibly invalidate automounting directory inodes | ||
654 | * (remote DFS directories) so to have them | ||
655 | * instantiated again for automount | ||
656 | */ | ||
657 | if (IS_AUTOMOUNT(direntry->d_inode)) | ||
658 | return 0; | ||
646 | return 1; | 659 | return 1; |
660 | } | ||
647 | } | 661 | } |
648 | 662 | ||
649 | /* | 663 | /* |