From d17d937137701bafe9f24332754f3b8102bf7412 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 24 Sep 2008 11:32:59 -0400 Subject: [PATCH] --- yaml --- r: 111151 b: refs/heads/master c: 7ce86d5a93ffe2542e6558a97ab055377df8cde3 h: refs/heads/master i: 111149: c72e962e90358b1b154073cb784184dfe15f474e 111147: 26f20c83e8586d378d9d2ec2518d83e5a76b9bad 111143: 856350fb54126eb81aafc4d8adb4ab1c3d8b7662 111135: e317c02235db79ed94106e9f2c0855cb9e8cecbc v: v3 --- [refs] | 2 +- trunk/fs/cifs/inode.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 1db2024badad..6aa1a38a27a0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 74553b1b6a8556e08757b4bce537fd8332b93898 +refs/heads/master: 7ce86d5a93ffe2542e6558a97ab055377df8cde3 diff --git a/trunk/fs/cifs/inode.c b/trunk/fs/cifs/inode.c index 079f39a8dd3b..27e97d43c759 100644 --- a/trunk/fs/cifs/inode.c +++ b/trunk/fs/cifs/inode.c @@ -778,7 +778,8 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid) FILE_BASIC_INFO *info_buf; rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, - DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, + DELETE|FILE_WRITE_ATTRIBUTES, + CREATE_NOT_DIR|CREATE_DELETE_ON_CLOSE, &netfid, &oplock, NULL, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (rc != 0) @@ -803,13 +804,20 @@ cifs_rename_pending_delete(char *full_path, struct inode *inode, int xid) goto out_close; /* silly-rename the file */ - rc = CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, + CIFSSMBRenameOpenFile(xid, tcon, netfid, NULL, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); /* set DELETE_ON_CLOSE */ rc = CIFSSMBSetFileDisposition(xid, tcon, true, netfid, current->tgid); + /* + * some samba versions return -ENOENT when we try to set the file + * disposition here. Likely a samba bug, but work around it for now + */ + if (rc == -ENOENT) + rc = 0; + out_close: CIFSSMBClose(xid, tcon, netfid); out: