Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0b98acd6
Commit
0b98acd6
authored
Sep 14, 2020
by
Ilya Dryomov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libceph, rbd, ceph: "blacklist" -> "blocklist"
Signed-off-by:
Ilya Dryomov
<
idryomov@gmail.com
>
parent
2e169296
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
39 additions
and
39 deletions
+39
-39
Documentation/filesystems/ceph.rst
Documentation/filesystems/ceph.rst
+3
-3
drivers/block/rbd.c
drivers/block/rbd.c
+4
-4
fs/ceph/addr.c
fs/ceph/addr.c
+12
-12
fs/ceph/file.c
fs/ceph/file.c
+2
-2
fs/ceph/mds_client.c
fs/ceph/mds_client.c
+8
-8
fs/ceph/super.c
fs/ceph/super.c
+2
-2
fs/ceph/super.h
fs/ceph/super.h
+2
-2
include/linux/ceph/mon_client.h
include/linux/ceph/mon_client.h
+1
-1
include/linux/ceph/rados.h
include/linux/ceph/rados.h
+1
-1
net/ceph/mon_client.c
net/ceph/mon_client.c
+4
-4
No files found.
Documentation/filesystems/ceph.rst
View file @
0b98acd6
...
...
@@ -163,14 +163,14 @@ Mount Options
to the default VFS implementation if this option is used.
recover_session=<no|clean>
Set auto reconnect mode in the case where the client is bl
a
cklisted. The
Set auto reconnect mode in the case where the client is bl
o
cklisted. The
available modes are "no" and "clean". The default is "no".
* no: never attempt to reconnect when client detects that it has been
bl
acklisted. Operations will generally fail after being bla
cklisted.
bl
ocklisted. Operations will generally fail after being blo
cklisted.
* clean: client reconnects to the ceph cluster automatically when it
detects that it has been bl
a
cklisted. During reconnect, client drops
detects that it has been bl
o
cklisted. During reconnect, client drops
dirty data/metadata, invalidates page caches and writable file handles.
After reconnect, file locks become stale because the MDS loses track
of them. If an inode contains any stale file locks, read/write on the
...
...
drivers/block/rbd.c
View file @
0b98acd6
...
...
@@ -4010,10 +4010,10 @@ static int rbd_try_lock(struct rbd_device *rbd_dev)
rbd_warn
(
rbd_dev
,
"breaking header lock owned by %s%llu"
,
ENTITY_NAME
(
lockers
[
0
].
id
.
name
));
ret
=
ceph_monc_bl
a
cklist_add
(
&
client
->
monc
,
ret
=
ceph_monc_bl
o
cklist_add
(
&
client
->
monc
,
&
lockers
[
0
].
info
.
addr
);
if
(
ret
)
{
rbd_warn
(
rbd_dev
,
"bl
a
cklist of %s%llu failed: %d"
,
rbd_warn
(
rbd_dev
,
"bl
o
cklist of %s%llu failed: %d"
,
ENTITY_NAME
(
lockers
[
0
].
id
.
name
),
ret
);
goto
out
;
}
...
...
@@ -4077,7 +4077,7 @@ static int rbd_try_acquire_lock(struct rbd_device *rbd_dev)
ret
=
rbd_try_lock
(
rbd_dev
);
if
(
ret
<
0
)
{
rbd_warn
(
rbd_dev
,
"failed to lock header: %d"
,
ret
);
if
(
ret
==
-
EBL
A
CKLISTED
)
if
(
ret
==
-
EBL
O
CKLISTED
)
goto
out
;
ret
=
1
;
/* request lock anyway */
...
...
@@ -4613,7 +4613,7 @@ static void rbd_reregister_watch(struct work_struct *work)
ret
=
__rbd_register_watch
(
rbd_dev
);
if
(
ret
)
{
rbd_warn
(
rbd_dev
,
"failed to reregister watch: %d"
,
ret
);
if
(
ret
!=
-
EBL
A
CKLISTED
&&
ret
!=
-
ENOENT
)
{
if
(
ret
!=
-
EBL
O
CKLISTED
&&
ret
!=
-
ENOENT
)
{
queue_delayed_work
(
rbd_dev
->
task_wq
,
&
rbd_dev
->
watch_dwork
,
RBD_RETRY_DELAY
);
...
...
fs/ceph/addr.c
View file @
0b98acd6
...
...
@@ -271,8 +271,8 @@ static int ceph_do_readpage(struct file *filp, struct page *page)
if
(
err
<
0
)
{
SetPageError
(
page
);
ceph_fscache_readpage_cancel
(
inode
,
page
);
if
(
err
==
-
EBL
A
CKLISTED
)
fsc
->
bl
a
cklisted
=
true
;
if
(
err
==
-
EBL
O
CKLISTED
)
fsc
->
bl
o
cklisted
=
true
;
goto
out
;
}
if
(
err
<
PAGE_SIZE
)
...
...
@@ -312,8 +312,8 @@ static void finish_read(struct ceph_osd_request *req)
int
i
;
dout
(
"finish_read %p req %p rc %d bytes %d
\n
"
,
inode
,
req
,
rc
,
bytes
);
if
(
rc
==
-
EBL
A
CKLISTED
)
ceph_inode_to_client
(
inode
)
->
bl
a
cklisted
=
true
;
if
(
rc
==
-
EBL
O
CKLISTED
)
ceph_inode_to_client
(
inode
)
->
bl
o
cklisted
=
true
;
/* unlock all pages, zeroing any data we didn't read */
osd_data
=
osd_req_op_extent_osd_data
(
req
,
0
);
...
...
@@ -737,8 +737,8 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
end_page_writeback
(
page
);
return
err
;
}
if
(
err
==
-
EBL
A
CKLISTED
)
fsc
->
bl
a
cklisted
=
true
;
if
(
err
==
-
EBL
O
CKLISTED
)
fsc
->
bl
o
cklisted
=
true
;
dout
(
"writepage setting page/mapping error %d %p
\n
"
,
err
,
page
);
mapping_set_error
(
&
inode
->
i_data
,
err
);
...
...
@@ -801,8 +801,8 @@ static void writepages_finish(struct ceph_osd_request *req)
if
(
rc
<
0
)
{
mapping_set_error
(
mapping
,
rc
);
ceph_set_error_write
(
ci
);
if
(
rc
==
-
EBL
A
CKLISTED
)
fsc
->
bl
a
cklisted
=
true
;
if
(
rc
==
-
EBL
O
CKLISTED
)
fsc
->
bl
o
cklisted
=
true
;
}
else
{
ceph_clear_error_write
(
ci
);
}
...
...
@@ -2038,16 +2038,16 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
if
(
err
>=
0
||
err
==
-
ENOENT
)
have
|=
POOL_READ
;
else
if
(
err
!=
-
EPERM
)
{
if
(
err
==
-
EBL
A
CKLISTED
)
fsc
->
bl
a
cklisted
=
true
;
if
(
err
==
-
EBL
O
CKLISTED
)
fsc
->
bl
o
cklisted
=
true
;
goto
out_unlock
;
}
if
(
err2
==
0
||
err2
==
-
EEXIST
)
have
|=
POOL_WRITE
;
else
if
(
err2
!=
-
EPERM
)
{
if
(
err2
==
-
EBL
A
CKLISTED
)
fsc
->
bl
a
cklisted
=
true
;
if
(
err2
==
-
EBL
O
CKLISTED
)
fsc
->
bl
o
cklisted
=
true
;
err
=
err2
;
goto
out_unlock
;
}
...
...
fs/ceph/file.c
View file @
0b98acd6
...
...
@@ -933,8 +933,8 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to,
ceph_release_page_vector
(
pages
,
num_pages
);
if
(
ret
<
0
)
{
if
(
ret
==
-
EBL
A
CKLISTED
)
fsc
->
bl
a
cklisted
=
true
;
if
(
ret
==
-
EBL
O
CKLISTED
)
fsc
->
bl
o
cklisted
=
true
;
break
;
}
...
...
fs/ceph/mds_client.c
View file @
0b98acd6
...
...
@@ -3303,7 +3303,7 @@ static void handle_forward(struct ceph_mds_client *mdsc,
}
static
int
__decode_session_metadata
(
void
**
p
,
void
*
end
,
bool
*
bl
a
cklisted
)
bool
*
bl
o
cklisted
)
{
/* map<string,string> */
u32
n
;
...
...
@@ -3318,7 +3318,7 @@ static int __decode_session_metadata(void **p, void *end,
ceph_decode_32_safe
(
p
,
end
,
len
,
bad
);
ceph_decode_need
(
p
,
end
,
len
,
bad
);
if
(
err_str
&&
strnstr
(
*
p
,
"blacklisted"
,
len
))
*
bl
a
cklisted
=
true
;
*
bl
o
cklisted
=
true
;
*
p
+=
len
;
}
return
0
;
...
...
@@ -3341,7 +3341,7 @@ static void handle_session(struct ceph_mds_session *session,
u32
op
;
u64
seq
,
features
=
0
;
int
wake
=
0
;
bool
bl
a
cklisted
=
false
;
bool
bl
o
cklisted
=
false
;
/* decode */
ceph_decode_need
(
&
p
,
end
,
sizeof
(
*
h
),
bad
);
...
...
@@ -3354,7 +3354,7 @@ static void handle_session(struct ceph_mds_session *session,
if
(
msg_version
>=
3
)
{
u32
len
;
/* version >= 2, metadata */
if
(
__decode_session_metadata
(
&
p
,
end
,
&
bl
a
cklisted
)
<
0
)
if
(
__decode_session_metadata
(
&
p
,
end
,
&
bl
o
cklisted
)
<
0
)
goto
bad
;
/* version >= 3, feature bits */
ceph_decode_32_safe
(
&
p
,
end
,
len
,
bad
);
...
...
@@ -3445,8 +3445,8 @@ static void handle_session(struct ceph_mds_session *session,
session
->
s_state
=
CEPH_MDS_SESSION_REJECTED
;
cleanup_session_requests
(
mdsc
,
session
);
remove_session_caps
(
session
);
if
(
bl
a
cklisted
)
mdsc
->
fsc
->
bl
a
cklisted
=
true
;
if
(
bl
o
cklisted
)
mdsc
->
fsc
->
bl
o
cklisted
=
true
;
wake
=
2
;
/* for good measure */
break
;
...
...
@@ -4367,14 +4367,14 @@ static void maybe_recover_session(struct ceph_mds_client *mdsc)
if
(
READ_ONCE
(
fsc
->
mount_state
)
!=
CEPH_MOUNT_MOUNTED
)
return
;
if
(
!
READ_ONCE
(
fsc
->
bl
a
cklisted
))
if
(
!
READ_ONCE
(
fsc
->
bl
o
cklisted
))
return
;
if
(
fsc
->
last_auto_reconnect
&&
time_before
(
jiffies
,
fsc
->
last_auto_reconnect
+
HZ
*
60
*
30
))
return
;
pr_info
(
"auto reconnect after bl
a
cklisted
\n
"
);
pr_info
(
"auto reconnect after bl
o
cklisted
\n
"
);
fsc
->
last_auto_reconnect
=
jiffies
;
ceph_force_reconnect
(
fsc
->
sb
);
}
...
...
fs/ceph/super.c
View file @
0b98acd6
...
...
@@ -1241,13 +1241,13 @@ int ceph_force_reconnect(struct super_block *sb)
* see remove_session_caps_cb() */
flush_workqueue
(
fsc
->
inode_wq
);
/* In case that we were bl
a
cklisted. This also reset
/* In case that we were bl
o
cklisted. This also reset
* all mon/osd connections */
ceph_reset_client_addr
(
fsc
->
client
);
ceph_osdc_clear_abort_err
(
&
fsc
->
client
->
osdc
);
fsc
->
bl
a
cklisted
=
false
;
fsc
->
bl
o
cklisted
=
false
;
fsc
->
mount_state
=
CEPH_MOUNT_MOUNTED
;
if
(
sb
->
s_root
)
{
...
...
fs/ceph/super.h
View file @
0b98acd6
...
...
@@ -32,7 +32,7 @@
#define CEPH_BLOCK_SHIFT 22
/* 4 MB */
#define CEPH_BLOCK (1 << CEPH_BLOCK_SHIFT)
#define CEPH_MOUNT_OPT_CLEANRECOVER (1<<1)
/* auto reonnect (clean mode) after bl
a
cklisted */
#define CEPH_MOUNT_OPT_CLEANRECOVER (1<<1)
/* auto reonnect (clean mode) after bl
o
cklisted */
#define CEPH_MOUNT_OPT_DIRSTAT (1<<4)
/* `cat dirname` for stats */
#define CEPH_MOUNT_OPT_RBYTES (1<<5)
/* dir st_bytes = rbytes */
#define CEPH_MOUNT_OPT_NOASYNCREADDIR (1<<7)
/* no dcache readdir */
...
...
@@ -109,7 +109,7 @@ struct ceph_fs_client {
unsigned
long
mount_state
;
unsigned
long
last_auto_reconnect
;
bool
bl
a
cklisted
;
bool
bl
o
cklisted
;
bool
have_copy_from2
;
...
...
include/linux/ceph/mon_client.h
View file @
0b98acd6
...
...
@@ -142,7 +142,7 @@ int ceph_monc_get_version(struct ceph_mon_client *monc, const char *what,
int
ceph_monc_get_version_async
(
struct
ceph_mon_client
*
monc
,
const
char
*
what
,
ceph_monc_callback_t
cb
,
u64
private_data
);
int
ceph_monc_bl
a
cklist_add
(
struct
ceph_mon_client
*
monc
,
int
ceph_monc_bl
o
cklist_add
(
struct
ceph_mon_client
*
monc
,
struct
ceph_entity_addr
*
client_addr
);
extern
int
ceph_monc_open_session
(
struct
ceph_mon_client
*
monc
);
...
...
include/linux/ceph/rados.h
View file @
0b98acd6
...
...
@@ -424,7 +424,7 @@ enum {
};
#define EOLDSNAPC ERESTART
/* ORDERSNAP flag set; writer has old snapc*/
#define EBL
ACKLISTED ESHUTDOWN
/* bla
cklisted */
#define EBL
OCKLISTED ESHUTDOWN
/* blo
cklisted */
/* xattr comparison */
enum
{
...
...
net/ceph/mon_client.c
View file @
0b98acd6
...
...
@@ -896,7 +896,7 @@ static void handle_command_ack(struct ceph_mon_client *monc,
ceph_msg_dump
(
msg
);
}
int
ceph_monc_bl
a
cklist_add
(
struct
ceph_mon_client
*
monc
,
int
ceph_monc_bl
o
cklist_add
(
struct
ceph_mon_client
*
monc
,
struct
ceph_entity_addr
*
client_addr
)
{
struct
ceph_mon_generic_request
*
req
;
...
...
@@ -936,9 +936,9 @@ int ceph_monc_blacklist_add(struct ceph_mon_client *monc,
ret
=
wait_generic_request
(
req
);
if
(
!
ret
)
/*
* Make sure we have the osdmap that includes the bl
a
cklist
* Make sure we have the osdmap that includes the bl
o
cklist
* entry. This is needed to ensure that the OSDs pick up the
* new bl
a
cklist before processing any future requests from
* new bl
o
cklist before processing any future requests from
* this client.
*/
ret
=
ceph_wait_for_latest_osdmap
(
monc
->
client
,
0
);
...
...
@@ -947,7 +947,7 @@ int ceph_monc_blacklist_add(struct ceph_mon_client *monc,
put_generic_request
(
req
);
return
ret
;
}
EXPORT_SYMBOL
(
ceph_monc_bl
a
cklist_add
);
EXPORT_SYMBOL
(
ceph_monc_bl
o
cklist_add
);
/*
* Resend pending generic requests.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment