Writing a simple CBT (changed block tracking) driver for Linux

Here is a simple Linux driver that can track all IO requests going to any particular block device. This might be useful when you want to write a simple CBT (changed block tracking) driver for Linux.
https://goo.gl/bCoEmz

The key here is to get block device queue, then replace the request function with your own

q = bdev_get_queue(bdev); 
orig = q->make_request_fn; 
q->make_request_fn = requestfunc;      
 

in your own request function you can print all struct bio information, using simple function like this:
static void printbio(struct bio *bio, char *pref) {

log ("%s bio=%p, dev=%x, sector=%lu, bi_flags=%lx" " bi_rw=%lx bi_size=%d bi_vcnt=%d bi_io_vec=%p" " bi_max_vecs=%d\n", pref, bio, bio->bi_bdev ? bio->bi_bdev->bd_dev : -1, bio->bi_iter.bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_iter.bi_size, bio->bi_vcnt, bio->bi_io_vec, bio->bi_max_vecs);

}

Using this technique, you can also create simple copy on write snapshot feature for the block devices that are not part of the LVM.
You can intercept IO request, save that BIO in memory (postponing it), then you create and submit new BIO to read original data from disk and only then you allow the first BIO to go through - simple COW snapshots.


new version(v3) of ppp patch implementing PEAP-MS-CHAP v2



Yesterday our admins updated our RRAS server, and it looks like PEAP protocol slightly changed.

Here is the new patch for PPP 2.4.7 that allows you to connect to MS RRAS via PEAP VPN

First of all some changes should be done on RRAS server, you need to configure the EAP Payload Size and set MTU to 1344. EAP doesn't support fragmentation per RFC but Microsoft implemented EAP fragmentation, however PPP daemon doesn't support it, and will discard packets that are large than MRU MTU negotiated during LCP

technet.microsoft.com/en-us/library/cc755205(v=ws.10).aspx

Patch itself: https://drive.google.com/file/d/0B3W_Sd07L80mN1BVWlFtejJGaGs/view?usp=sharing
Also you will need gnutls-dev package

patch modifies default setup location, from /usr/local to /usr so make sure you run a proper pppd

here is some part of config for peer: 
remotename login@domain.com 

 and chap file 
# client server secret IP addresses
login@domain.com * password * 

 if you specify a login in different manner(without @) you'll get a segmentation fault

ppp patch implementing PEAP-MS-CHAP v2

Here is the patch that implements PEAP(type 25) support to ppp linux daemon
Tested with 2008R2 Microsoft RAS server
Applied to 2.4.5 ppp
Thanks to wpa_supplicant(tls impl.) and wireshark creators(tls disect), some part of code was taken from there

patch itself:
https://docs.google.com/open?id=0B3W_Sd07L80mdXkxZWVTVVFZSFU

patch modifies default setup location, from /usr/local to /usr
so make sure you run a proper pppd

here is some part of config for peer:
name login@domain.com
remotename login@domain.com

and chap file
# client        server  secret                  IP addresses
login@domain.com * password *

if you specify a login in different manner(without @) you'll get a segmentation fault, I didn't have much time to implement proper error checking, so it's like a band aid =).



Enjoy!!

vSphere Events

Working on new version of vSphere events, new design, and few more features!!