Hi, In Linux 3.18 kenrel, when fstrim a ocfs2 file system, fstrim shows IO error. Some logs in syslog: attempt to access beyond end of device sdb: rw=129, want=8390656, limit=8388608 (fstrim,36298,6):ocfs2_trim_group:7274 ERROR: status = -5 (fstrim,36298,6):ocfs2_trim_fs:7374 ERROR: status = -5
In ocfs2_trim_group, next shoud compare with ip_clusters before call ocfs2_trim_extent. while (start < max) { start = ocfs2_find_next_zero_bit(bitmap, max, start); if (start >= max) break; next = ocfs2_find_next_bit(bitmap, max, start); /* next should compare with ip_clusters, ensure within device. But how to get ip_clusters here? Should pass inode from the caller? */ if (next > ip_clusters) next = ip_clusters; if (next > start && (next - start) >= minbits) { ret = ocfs2_trim_extent(sb, gd, start, next - start); if (ret < 0) { mlog_errno(ret); break; } count += next - start; } Regards, Changlimin ------------------------------------------------------------------------------------------------------------------------------------- 本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出 的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、 或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本 邮件! This e-mail and its attachments contain confidential information from H3C, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
_______________________________________________ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel