2012-06-07 19:06:43

by Idan Kedar

[permalink] [raw]
Subject: [PATCH 0/2] pNFS: disable unloading a layout driver when mounted

Layout drivers' refcount is incremented when a filesystem is mounted with
the layout type exported by the driver. Object layout and Block layout
drivers did not provide an owner, which means no refcount is incremented
and that the module can be unloaded while the file system is mounted
which, in turn, crashes in the layout driver when the NFS client attempts
to do something with the layout driver (typically coalescing).

Idan Kedar (2):
pnfs-obj: disable unloading the module when mounted
pnfsblock: disable unloading the module when mounted

fs/nfs/blocklayout/blocklayout.c | 1 +
fs/nfs/objlayout/objio_osd.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)

--
1.7.6.5



2012-06-07 19:06:46

by Idan Kedar

[permalink] [raw]
Subject: [PATCH 2/2] pnfsblock: disable unloading the module when mounted

Signed-off-by: Idan Kedar <[email protected]>
---
fs/nfs/blocklayout/blocklayout.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 48cfac3..c0a1464 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -1005,6 +1005,7 @@ static const struct nfs_pageio_ops bl_pg_write_ops = {
static struct pnfs_layoutdriver_type blocklayout_type = {
.id = LAYOUT_BLOCK_VOLUME,
.name = "LAYOUT_BLOCK_VOLUME",
+ .owner = THIS_MODULE,
.read_pagelist = bl_read_pagelist,
.write_pagelist = bl_write_pagelist,
.alloc_layout_hdr = bl_alloc_layout_hdr,
--
1.7.6.5


2012-06-07 19:06:44

by Idan Kedar

[permalink] [raw]
Subject: [PATCH 1/2] pnfs-obj: disable unloading the module when mounted

or the kernel will oops.

Signed-off-by: Idan Kedar <[email protected]>
---
fs/nfs/objlayout/objio_osd.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index 55d0128..b161f97 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -551,6 +551,7 @@ static const struct nfs_pageio_ops objio_pg_write_ops = {
static struct pnfs_layoutdriver_type objlayout_type = {
.id = LAYOUT_OSD2_OBJECTS,
.name = "LAYOUT_OSD2_OBJECTS",
+ .owner = THIS_MODULE,
.flags = PNFS_LAYOUTRET_ON_SETATTR |
PNFS_LAYOUTRET_ON_ERROR,

--
1.7.6.5


2012-06-07 21:09:15

by Boaz Harrosh

[permalink] [raw]
Subject: Re: [PATCH 1/2] pnfs-obj: disable unloading the module when mounted

On 06/07/2012 10:06 PM, Idan Kedar wrote:

> or the kernel will oops.
>


Perfect Thanks

> Signed-off-by: Idan Kedar <[email protected]>
> ---
> fs/nfs/objlayout/objio_osd.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
> index 55d0128..b161f97 100644
> --- a/fs/nfs/objlayout/objio_osd.c
> +++ b/fs/nfs/objlayout/objio_osd.c
> @@ -551,6 +551,7 @@ static const struct nfs_pageio_ops objio_pg_write_ops = {
> static struct pnfs_layoutdriver_type objlayout_type = {
> .id = LAYOUT_OSD2_OBJECTS,
> .name = "LAYOUT_OSD2_OBJECTS",
> + .owner = THIS_MODULE,
> .flags = PNFS_LAYOUTRET_ON_SETATTR |
> PNFS_LAYOUTRET_ON_ERROR,
>