From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/2] btrfs: maintain consistent fmode flags for device open
Date: Fri, 20 Oct 2017 18:33:25 +0800 [thread overview]
Message-ID: <20171020103325.9595-2-anand.jain@oracle.com> (raw)
In-Reply-To: <20171020103325.9595-1-anand.jain@oracle.com>
Devices opened through replace/add would have FMODE_WRITE | FMODE_EXCL,
as compared with devices opened through the mount which will have
FMODE_READ | FMODE_WRITE | FMODE_EXCL. So maintain consistency.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/volumes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 765c2bd2d8d9..7008b5d104d4 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2323,7 +2323,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
u64 tmp;
int seeding_dev = 0;
int ret = 0;
- fmode_t flag = FMODE_WRITE | FMODE_EXCL;
+ fmode_t flag = FMODE_READ | FMODE_WRITE | FMODE_EXCL;
if (sb_rdonly(sb) && !fs_info->fs_devices->seeding)
return -EROFS;
@@ -2526,7 +2526,7 @@ int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
struct rcu_string *name;
u64 devid = BTRFS_DEV_REPLACE_DEVID;
int ret = 0;
- fmode_t flags = FMODE_WRITE | FMODE_EXCL;
+ fmode_t flags = FMODE_READ | FMODE_WRITE | FMODE_EXCL;
*device_out = NULL;
if (fs_info->fs_devices->seeding) {
--
2.13.1
next prev parent reply other threads:[~2017-10-20 10:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 10:33 [PATCH 1/2] btrfs: match btrfs_device->mode same as it used for open Anand Jain
2017-10-20 10:33 ` Anand Jain [this message]
2017-10-20 12:26 ` Nikolay Borisov
2017-10-20 14:00 ` Anand Jain
2017-10-20 14:07 ` [PATCH v2 " Anand Jain
2017-10-30 14:39 ` David Sterba
2017-10-31 2:11 ` Anand Jain
2017-10-31 14:21 ` Nikolay Borisov
2017-11-02 5:55 ` Anand Jain
2017-11-02 6:11 ` [PATCH v3 " Anand Jain
2017-11-02 8:47 ` Nikolay Borisov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171020103325.9595-2-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).