Re: [PATCH 2/2] block-rbd: One function call less in rbd_dev_probe_parent() after error detection

2015-11-25 Thread Dan Carpenter
ret; 5190 } I feel like we should be calling rbd_put_client() on this error path or else the code is buggy or has layer violations. So I *think* it should look like this: dec_ref_counts: rbd_spec_put(rbd_dev->parent_spec); rbd_put_client(rbd_dev->rbd_client); rbd_dev_destroy(pa

re: ceph: cope with out of order (unsafe after safe) mds reply

2015-08-10 Thread Dan Carpenter
thing different is the error message. 2415 pr_warn(got unsafe after safe on %llu from mds%d\n, 2416 tid, mds); 2417 mutex_unlock(mdsc-mutex); 2418 goto out; 2419 } regards, dan carpenter

[patch] ceph: do_sync is never initialized

2014-11-28 Thread Dan Carpenter
Probably this code was syncing a lot more often then intended because the do_sync variable wasn't set to zero. Fixes: c62988ec0910 ('ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Static checker stuff

re: ceph: fix fallocate division

2014-10-23 Thread Dan Carpenter
*/ 1149 nearly = offset + object_set_size - 1; 1150 t = nearly; 1151 nearly -= do_div(t, object_set_size); 1152 regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org

Re: rbd: use watch/notify for changes in rbd header

2014-02-13 Thread Dan Carpenter
On Thu, Feb 13, 2014 at 06:27:41AM -0600, Alex Elder wrote: On 02/13/2014 06:04 AM, Ilya Dryomov wrote: On Thu, Feb 13, 2014 at 11:50 AM, Dan Carpenter dan.carpen...@oracle.com wrote: Hello Yehuda Sadeh, The patch 59c2be1e4d42: rbd: use watch/notify for changes in rbd header from Mar

re: ceph: handle frag mismatch between readdir request and reply

2013-09-28 Thread Dan Carpenter
dn %p\n, 1311 rinfo-dir_nr, parent); 1312 if (rinfo-dir_dir) ^^ Old check. 1313 ceph_fill_dirfrag(parent-d_inode, rinfo-dir_dir); 1314 } regards, dan carpenter

re: ceph: remove outdated frag information

2013-09-28 Thread Dan Carpenter
, frag-frag, frag-split_by); regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch 3/2] libceph: create_singlethread_workqueue() doesn't return ERR_PTRs

2013-08-15 Thread Dan Carpenter
create_singlethread_workqueue() returns NULL on error, and it doesn't return ERR_PTRs. I tweaked the error handling a little to be consistent with earlier in the function. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index

[patch 1/2] libceph: fix error handling in handle_reply()

2013-08-14 Thread Dan Carpenter
We've tried to fix the error paths in this function before, but there is still a hidden goto in the ceph_decode_need() macro which goes to the wrong place. We need to release the req and unlock a mutex before returning. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/net/ceph

[patch 2/2] libceph: potential NULL dereference in ceph_osdc_handle_map()

2013-08-14 Thread Dan Carpenter
There are two places where we read nr_maps if both of them are set to zero then we would hit a NULL dereference here. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- I think this is a real bug, but please review my fix for it because I'm not very familiar with this code. diff --git

[parch] ceph: cleanup types in striped_read()

2013-07-23 Thread Dan Carpenter
We pass in a u64 value for len and then immediately truncate away the upper 32 bits. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 2ddf061..93e53c8 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -313,9 +313,9 @@ static int

re: rbd: refactor rbd_header_from_disk()

2013-06-20 Thread Dan Carpenter
) 815 goto out_err; regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] ceph: tidy ceph_mdsmap_decode() a little

2013-05-29 Thread Dan Carpenter
I introduced a new temporary variable info instead of m-m_info[mds]. Also I reversed the if condition and pulled everything in one indent level. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- This goes on top of Emil Goode's patch. diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c

Re: [patch] ceph: tidy ceph_mdsmap_decode() a little

2013-05-29 Thread Dan Carpenter
On Wed, May 29, 2013 at 09:17:21AM +0200, walter harms wrote: personally i would go for: info-export_targets = NULL; and remove the else below. I don't have strong feelings one way or the other, but honestly, I think the way I sent it is more clear. regards, dan carpenter

[patch] ceph: remove unneeded truncation

2013-05-23 Thread Dan Carpenter
My static checker complains l-stripe_unit could still be zero after we truncate it to 32 bits. I don't see a reason to do the truncation so I have removed it. Both sides are u64 type. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index

Re: rbd: enforce parent overlap

2013-04-30 Thread Dan Carpenter
On Tue, Apr 30, 2013 at 06:57:14AM -0500, Alex Elder wrote: On 04/30/2013 02:24 AM, Dan Carpenter wrote: Hello Alex Elder, This is a semi-automatic email about new static checker warnings. Cool, I've never used smatch before. Great to get these automated warnings. I looked

re: crush: warn on do_rule failure

2012-10-03 Thread Dan Carpenter
; regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

re: ceph: fix encoding of ino only (not relative) paths

2012-09-28 Thread Dan Carpenter
*pathlen = strlen(rpath); ^ Dereference. 1594 dout( path %.*s\n, *pathlen, rpath); 1595 } regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message

re: ceph: factor out libceph from Ceph file system

2012-09-28 Thread Dan Carpenter
} 281 regards, dan carpenter See also: -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: ceph: factor out libceph from Ceph file system

2012-09-28 Thread Dan Carpenter
Oh crap. I didn't read this at all. Obviously a false positive. Sorry about that. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

[patch] ceph: divide by zero bug in __validate_layout()

2012-08-18 Thread Dan Carpenter
If l-stripe_unit is zero the the mod on the next line will cause a divide by zero bug. This comes from the copy_from_user() in ceph_ioctl_set_layout_policy() Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 8e3fb69..81ec22b 100644

[patch -next] libceph: fix NULL dereference in reset_connection()

2012-06-19 Thread Dan Carpenter
We dereference con-in_msg on the line after it was set to NULL. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 5e9f61d..6aa671c 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -437,10 +437,10 @@ static void

Re: [patch -next] libceph: fix NULL dereference in reset_connection()

2012-06-19 Thread Dan Carpenter
On Tue, Jun 19, 2012 at 08:27:19AM -0500, Alex Elder wrote: On 06/19/2012 05:33 AM, Dan Carpenter wrote: We dereference con-in_msg on the line after it was set to NULL. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Yikes. Actually I think I prefer a different fix, which

[patch] rbd: endian bug in rbd_req_cb()

2012-05-04 Thread Dan Carpenter
Sparse complains about this because: drivers/block/rbd.c:996:20: warning: cast to restricted __le32 drivers/block/rbd.c:996:20: warning: cast from restricted __le16 These are set in osd_req_encode_op() and they are le16. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers

re: ceph: move encode_fh to new API

2012-04-18 Thread Dan Carpenter
if it's a false positive then I blame the script. Hope it's not too much spam. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe ceph-devel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch] rbd: use gfp_flags parameter in rbd_header_from_disk()

2012-03-22 Thread Dan Carpenter
We should use the gfp_flags that the caller specified instead of GFP_KERNEL here. There is only one caller and it uses GFP_KERNEL, so this change is just a cleanup and doesn't change how the code works. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/block/rbd.c b

[patch 1/2] ceph: null deref on allocation failure

2011-03-28 Thread Dan Carpenter
The original code checked event_work for allocation failures, but only after it had already use it. Signed-off-by: Dan Carpenter erro...@gmail.com diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 02212ed..b6776cb 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c

potential null dereference in __dcache_readdir()

2010-11-19 Thread Dan Carpenter
...@newdream.net Date: Tue Oct 6 11:31:08 2009 -0700 ceph: directory operations regards, dan carpenter fs/ceph/dir.c +124 __dcache_readdir(28) error: we previously assumed 'last' could be null. 116 /* start at beginning? */ 117 if (filp-f_pos == 2

[patch 1/2 -next] rbd: null vs ERR_PTR

2010-10-11 Thread Dan Carpenter
ceph_alloc_page_vector() returns ERR_PTR(-ENOMEM) on errors. Signed-off-by: Dan Carpenter erro...@gmail.com diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 1ac87f1..52f9420 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -826,8 +826,8 @@ static int rbd_req_sync_op

[patch 2/2 -next] rbd: passing wrong variable to bvec_kunmap_irq()

2010-10-11 Thread Dan Carpenter
We should be passing buf here insead of bv. This is tricky because it's not the same as kmap() and kunmap(). GCC does warn about it if you compile on i386 with CONFIG_HIGHMEM. Signed-off-by: Dan Carpenter erro...@gmail.com --- If it's any consolation, out of three callers to bvec_kunmap_irq

[patch] ceph: ceph_mdsc_build_path() returns an ERR_PTR

2010-08-26 Thread Dan Carpenter
ceph_mdsc_build_path() returns an ERR_PTR but this code is set up to handle NULL returns. Signed-off-by: Dan Carpenter erro...@gmail.com diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index 360c4f2..6fd8b20 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -171,6 +171,8 @@ static int