cifs: set FILE_CREATED
Set FILE_CREATED on O_CREAT|O_EXCL.
cifs code didn't change during commit 116cc02253
Kernel bugzilla 66251
Signed-off-by: Shirish Pargaonkar <spargaonkar@suse.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
CC: Stable <stable@kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
This commit is contained in:
parent
750b8de6c4
commit
f1e3268126
|
@ -193,7 +193,7 @@ check_name(struct dentry *direntry)
|
||||||
static int
|
static int
|
||||||
cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
|
cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
|
||||||
struct tcon_link *tlink, unsigned oflags, umode_t mode,
|
struct tcon_link *tlink, unsigned oflags, umode_t mode,
|
||||||
__u32 *oplock, struct cifs_fid *fid, int *created)
|
__u32 *oplock, struct cifs_fid *fid)
|
||||||
{
|
{
|
||||||
int rc = -ENOENT;
|
int rc = -ENOENT;
|
||||||
int create_options = CREATE_NOT_DIR;
|
int create_options = CREATE_NOT_DIR;
|
||||||
|
@ -349,7 +349,6 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
|
||||||
.device = 0,
|
.device = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
*created |= FILE_CREATED;
|
|
||||||
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
|
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
|
||||||
args.uid = current_fsuid();
|
args.uid = current_fsuid();
|
||||||
if (inode->i_mode & S_ISGID)
|
if (inode->i_mode & S_ISGID)
|
||||||
|
@ -480,13 +479,16 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
|
||||||
cifs_add_pending_open(&fid, tlink, &open);
|
cifs_add_pending_open(&fid, tlink, &open);
|
||||||
|
|
||||||
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
|
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
|
||||||
&oplock, &fid, opened);
|
&oplock, &fid);
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
cifs_del_pending_open(&open);
|
cifs_del_pending_open(&open);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
|
||||||
|
*opened |= FILE_CREATED;
|
||||||
|
|
||||||
rc = finish_open(file, direntry, generic_file_open, opened);
|
rc = finish_open(file, direntry, generic_file_open, opened);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (server->ops->close)
|
if (server->ops->close)
|
||||||
|
@ -529,7 +531,6 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
|
||||||
struct TCP_Server_Info *server;
|
struct TCP_Server_Info *server;
|
||||||
struct cifs_fid fid;
|
struct cifs_fid fid;
|
||||||
__u32 oplock;
|
__u32 oplock;
|
||||||
int created = FILE_CREATED;
|
|
||||||
|
|
||||||
cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
|
cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
|
||||||
inode, direntry->d_name.name, direntry);
|
inode, direntry->d_name.name, direntry);
|
||||||
|
@ -546,7 +547,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
|
||||||
server->ops->new_lease_key(&fid);
|
server->ops->new_lease_key(&fid);
|
||||||
|
|
||||||
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
|
rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
|
||||||
&oplock, &fid, &created);
|
&oplock, &fid);
|
||||||
if (!rc && server->ops->close)
|
if (!rc && server->ops->close)
|
||||||
server->ops->close(xid, tcon, &fid);
|
server->ops->close(xid, tcon, &fid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue