The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=661db9b390b4a40418d838876b58d2186d72aabf

commit 661db9b390b4a40418d838876b58d2186d72aabf
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2024-01-17 23:05:55 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2024-01-18 16:48:05 +0000

    msdosfs_rename(): implement several XXXs about downgrading to ro
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D43482
---
 sys/fs/msdosfs/msdosfs_vnops.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 726b1d8e5cb7..31d9b003a6fa 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -1203,7 +1203,10 @@ relock:
        MPASS(error == 0);
        error = removede(fdip, fip);
        if (error != 0) {
-               /* XXX should downgrade to ro here, fs is corrupt */
+               printf("%s: removede %s %s err %d\n",
+                   pmp->pm_mountp->mnt_stat.f_mntonname,
+                   fdip->de_Name, fip->de_Name, error);
+               msdosfs_integrity_error(pmp);
                goto unlock;
        }
        if (!doingdirectory) {
@@ -1237,7 +1240,10 @@ relock:
                error = bread(pmp->pm_devvp, bn, pmp->pm_bpcluster,
                    NOCRED, &bp);
                if (error != 0) {
-                       /* XXX should downgrade to ro here, fs is corrupt */
+                       printf("%s: block read error %d while renaming dir\n",
+                           pmp->pm_mountp->mnt_stat.f_mntonname,
+                           error);
+                       msdosfs_integrity_error(pmp);
                        goto unlock;
                }
                dotdotp = (struct direntry *)bp->b_data + 1;
@@ -1250,7 +1256,10 @@ relock:
                if (DOINGASYNC(fvp))
                        bdwrite(bp);
                else if ((error = bwrite(bp)) != 0) {
-                       /* XXX should downgrade to ro here, fs is corrupt */
+                       printf("%s: block write error %d while renaming dir\n",
+                           pmp->pm_mountp->mnt_stat.f_mntonname,
+                           error);
+                       msdosfs_integrity_error(pmp);
                        goto unlock;
                }
        }

Reply via email to