<div dir="auto">Thank you for the clarification. I am proceeding to check the CFS_FAIL_CHECK(). </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 1, 2024 at 3:59 PM Andreas Dilger <<a href="mailto:adilger@whamcloud.com">adilger@whamcloud.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
<div style="line-break:after-white-space">
You cannot use debugfs to modify a mounted filesystem, no differently than you cannot replace the tire on your car while you are driving it on the highway...
<div><br>
</div>
<div>If you want to inject corruption into the filesystem while it is mounted (without corrupting the whole filesystem), you could use "CFS_FAIL_CHECK()" to add fault injection points directly into the code, as is done by LFSCK to create specific corruptions
and then repair them (see lustre/tests/sanity-lfsck.sh).</div>
<div><br>
</div>
<div>Cheers, Andreas</div></div><div style="line-break:after-white-space"><div><br>
<div><br>
<blockquote type="cite">
<div>On Jan 31, 2024, at 18:41, Saisha Kamat via lustre-devel <<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a>> wrote:</div>
<br>
<div>
<div>Hello Artem,<br>
<br>
I apologize for the delay in my response. I also want to thank you for<br>
the suggestion.<br>
However, our objective is to inject modifications while Lustre is<br>
mounted, specifically targeting xattr faults such as LMA, Linkea, and<br>
Lovea. Could you please advise on which debugfs utility I can use for<br>
this purpose?<br>
<br>
We would greatly appreciate your guidance and clarity on these matters.<br>
<br>
Thanks and Regards,<br>
Saisha<br>
<br>
On Fri, Jan 26, 2024 at 5:24 PM Blagodarenko Artem<br>
<<a href="mailto:artem.blagodarenko@gmail.com" target="_blank">artem.blagodarenko@gmail.com</a>> wrote:<br>
<blockquote type="cite"><br>
[Caution: Email from External Sender. Do not click or open links or attachments unless you know this sender.]<br>
<br>
<br>
Hi Saisha,<br>
<br>
<br>
<br>
Thanks for your interest in Lustre FS and research efforts.<br>
<br>
Regarding your question. Had MDS been mounted when there was the xattre direct modification attempt?<br>
<br>
If yes, then xattr data consistency is not guaranteed.<br>
<br>
If it is possible, unmount MDS, make modifications, and mount it back.<br>
<br>
<br>
<br>
If MDS backend is LDISKFS, after unmounting MDS, you can mount it as<br>
<br>
<br>
<br>
Mount -t ldiskfs <path_to_dev> <mount_point> and modify any file.<br>
<br>
There is also debugfs utility which allows perform many useful modifications without mounting.<br>
<br>
<br>
<br>
Best regards,<br>
<br>
Artem Blagodarenko<br>
<br>
<br>
<br>
Best rega<br>
<br>
From: lustre-devel <a href="mailto:lustre-devel-bounces@lists.lustre.org" target="_blank">
lustre-devel-bounces@lists.lustre.org</a> on behalf of Saisha Kamat via lustre-devel
<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a><br>
Date: Friday, 26 January 2024 at 19:58<br>
To: <a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a>
<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a><br>
Subject: [lustre-devel] Direct Modification of Lustre Metadata on Disk<br>
<br>
Hello,<br>
<br>
I am a Ph.D. student at UNC-Charlotte, focusing on research related to<br>
the Lustre File System. As part of my project, I am investigating<br>
scenarios involving the direct modification of xattr metadata on the<br>
Lustre disk, without unmounting the Lustre servers.<br>
<br>
To achieve this, I have attempted to open the MDS (Metadata Server)<br>
disk partition as a file descriptor, locate the target file and its<br>
xattr, and write a faulty value. However, I have encountered an<br>
unexpected issue where my changes appear to be saved to memory and are<br>
not being synchronized with the disk.<br>
After completing the write operation, when I read the same xattr<br>
again, it reflects the corrupted value. Strangely, when using the<br>
"getfattr" command, the original, correct value is displayed. This<br>
discrepancy has raised doubts about whether Lustre permits direct<br>
modifications to its metadata on the disk.<br>
Furthermore, I observed that even after unmounting and remounting the<br>
Lustre file system, the xattr continues to display the corrupted value<br>
upon reading, whereas "getfattr" still returns the original, correct<br>
value.<br>
<br>
Please help me understand whether Lustre allows direct modifications<br>
to its metadata on the disk and if there are any inherent limitations<br>
or considerations that I should be aware of.<br>
Additionally, any recommendations or alternative approaches for<br>
simulating faulty conditions for testing purposes would be highly<br>
valuable to my research.<br>
<br>
Thanks and Regards,<br>
Saisha<br>
_______________________________________________<br>
lustre-devel mailing list<br>
<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a><br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org" target="_blank">http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org</a><br>
<br>
<br>
</blockquote>
_______________________________________________<br>
lustre-devel mailing list<br>
<a href="mailto:lustre-devel@lists.lustre.org" target="_blank">lustre-devel@lists.lustre.org</a><br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org" target="_blank">http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;line-break:after-white-space;color:rgb(0,0,0)">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;line-break:after-white-space;color:rgb(0,0,0)">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;line-break:after-white-space;color:rgb(0,0,0)">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;line-break:after-white-space;color:rgb(0,0,0)">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;line-break:after-white-space;color:rgb(0,0,0)">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;line-break:after-white-space;color:rgb(0,0,0)">
<div>Cheers, Andreas</div>
<div>--</div>
<div>Andreas Dilger</div>
<div>Lustre Principal Architect</div>
<div>Whamcloud</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
<br>
<br>
</div>
<br>
</div>
</div>
</blockquote></div></div>