linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pnfs-block: may be return NULL when find a extent
@ 2013-03-12  6:09 fanchaoting
  2013-03-12 10:27 ` Peng, Tao
  0 siblings, 1 reply; 3+ messages in thread
From: fanchaoting @ 2013-03-12  6:09 UTC (permalink / raw)
  To: Myklebust, Trond; +Cc: linux-nfs@vger.kernel.org

maybe return NULL when find a extent, if we use it later,
it will cause oops.

 Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>
---
 fs/nfs/blocklayout/extents.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/blocklayout/extents.c b/fs/nfs/blocklayout/extents.c
index 9c3e117..131ea59 100644
--- a/fs/nfs/blocklayout/extents.c
+++ b/fs/nfs/blocklayout/extents.c
@@ -762,6 +762,11 @@ set_to_rw(struct pnfs_block_layout *bl, u64 offset, u64 length)

        spin_lock(&bl->bl_ext_lock);
        be = bl_find_get_extent_locked(bl, offset);
+       if (!be) {
+               spin_unlock(&bl->bl_ext_lock);
+               goto out_nosplit;
+       }
+
        rv = be->be_f_offset + be->be_length;
        if (be->be_state != PNFS_BLOCK_INVALID_DATA) {
                spin_unlock(&bl->bl_ext_lock);
--
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-13  0:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-12  6:09 [PATCH] pnfs-block: may be return NULL when find a extent fanchaoting
2013-03-12 10:27 ` Peng, Tao
2013-03-13  0:55   ` fanchaoting

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).