btrfs-progs: always print error messages from btrfs_open_fd2()
There are some cases that disable verbosity (of errors) and then print own message. Enable the verbose error messages printed by btrfs_open_fd2() as they are specific. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
3fbcce4544
commit
9b5f104558
|
@ -456,7 +456,7 @@ static int du_add_file(const char *filename, int dirfd,
|
|||
ret = sprintf(pathp, "/%s", filename);
|
||||
pathp += ret;
|
||||
|
||||
fd = btrfs_open_fd2(path, false, false, false);
|
||||
fd = btrfs_open_fd2(path, true, false, false);
|
||||
if (fd < 0) {
|
||||
ret = fd;
|
||||
goto out;
|
||||
|
|
|
@ -1150,10 +1150,8 @@ static int cmd_filesystem_defrag(const struct cmd_struct *cmd,
|
|||
struct stat st;
|
||||
int defrag_err = 0;
|
||||
|
||||
fd = btrfs_open_fd2(argv[i], false, defrag_open_mode == O_RDWR, false);
|
||||
fd = btrfs_open_fd2(argv[i], true, defrag_open_mode == O_RDWR, false);
|
||||
if (fd < 0) {
|
||||
errno = -fd;
|
||||
error("cannot open %s: %m", argv[i]);
|
||||
ret = fd;
|
||||
goto next;
|
||||
}
|
||||
|
|
|
@ -179,10 +179,8 @@ static int prop_compression(enum prop_object_type type,
|
|||
char *xattr_name = NULL;
|
||||
int open_flags = value ? O_RDWR : O_RDONLY;
|
||||
|
||||
fd = btrfs_open_fd2(object, false, open_flags == O_RDWR, false);
|
||||
fd = btrfs_open_fd2(object, true, open_flags == O_RDWR, false);
|
||||
if (fd < 0) {
|
||||
errno = -fd;
|
||||
error("failed to open %s: %m", object);
|
||||
ret = fd;
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue