Thread (6 messages) 6 messages, 3 authors, 2019-01-09

Re: [PATCH v3] loop: drop caches if offset or block_size are changed

From: Bart Van Assche <bvanassche@acm.org>
Date: 2019-01-09 20:51:36
Also in: lkml

On Tue, 2018-12-18 at 14:41 -0800, Jaegeuk Kim wrote:
[ ... ]
Please post new versions of a patch as a new e-mail thread instead of
as a reply to a previous e-mail.
[ ... ]

 	if (lo->lo_offset != info->lo_offset ||
 	    lo->lo_sizelimit != info->lo_sizelimit) {
+		/* kill_bdev should have truncated all the pages */
+		if (lo->lo_device->bd_inode->i_mapping->nrpages) {
+			err = -EAGAIN;
+			goto exit;
+		}
Please add a pr_info() or pr_warn() statement here such that it becomes
easy for the user to figure out why EAGAIN has been returned.
 	blk_mq_freeze_queue(lo->lo_queue);
 
+	/* kill_bdev should have truncated all the pages */
+	if (lo->lo_queue->limits.logical_block_size != arg &&
+			lo->lo_device->bd_inode->i_mapping->nrpages) {
+		err = -EAGAIN;
+		goto out;
+	}
Same comment here. Additionally, please consider renaming the "out" label
into "unfreeze" or so. I think that will make the use of label names more
consistent with the rest of the block layer. Once these two comments are
addressed, feel free to add:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help