btrfs-progs: drop O_CREATE from open_ctree_fs_info
We stat the filesystem path before trying to open it so there's no point to pass O_CREAT ("btrfs-progs: add stat check in open_ctree_fs_info"). Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
6f508a01f5
commit
c27db1238a
|
@ -1328,7 +1328,7 @@ struct btrfs_fs_info *open_ctree_fs_info(const char *filename,
|
|||
int fp;
|
||||
int ret;
|
||||
struct btrfs_fs_info *info;
|
||||
int oflags = O_CREAT | O_RDWR;
|
||||
int oflags = O_RDWR;
|
||||
struct stat st;
|
||||
|
||||
ret = stat(filename, &st);
|
||||
|
@ -1344,7 +1344,7 @@ struct btrfs_fs_info *open_ctree_fs_info(const char *filename,
|
|||
if (!(flags & OPEN_CTREE_WRITES))
|
||||
oflags = O_RDONLY;
|
||||
|
||||
fp = open(filename, oflags, 0600);
|
||||
fp = open(filename, oflags);
|
||||
if (fp < 0) {
|
||||
error("cannot open '%s': %s", filename, strerror(errno));
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue