[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] NBD, DISCARD/TRIM



On Tue, Mar 19, 2013 at 2:06 PM, folkert <folkert@...421...> wrote:
>> > > Am I right that discard/trim is in kernel 3.9? Or is it already in 3.8?
>> > Patch was merged into Linus's tree on 5Oct12, so it should have made 3.7.
>>
>> There are problems with it, it seems.

Doesn't seem to be anything related to trim/discard. Does your kernel
have the kill_bdev calls in nbd? Look for:

@@ -627,6 +635,7 @@ static int __nbd_ioctl(struct block_devi
                nbd_clear_que(nbd);
                BUG_ON(!list_empty(&nbd->queue_head));
                BUG_ON(!list_empty(&nbd->waiting_queue));
+               kill_bdev(bdev);
                if (file)
                        fput(file);
                return 0;
@@ -719,6 +728,7 @@ static int __nbd_ioctl(struct block_devi
                nbd->file = NULL;
                nbd_clear_que(nbd);
                dev_warn(disk_to_dev(nbd->disk), "queue cleared\n");
+               kill_bdev(bdev);
                queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue);
                if (file)
                        fput(file);



Reply to: