[PATCH] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread ritvikfoss
From: Ritvik Gupta 1. Close the file descriptor when write fails. 2. Introduce 'close_or_die' helper function to reduce repetition. Signed-off-by: Ritvik Gupta --- .../selftests/mount/unprivileged-remount-test.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --gi

[PATCH] selftests/mount: Explicitly define buffer size

2025-02-22 Thread ritvikfoss
From: Ritvik Gupta Define macro ('MAX_BUF_SIZE') for buffer size instead of hardcoded value '4096', to improve readability. Signed-off-by: Ritvik Gupta --- tools/testing/selftests/mount/unprivileged-remount-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tes

[PATCH v2] selftests/mount: Close 'fd' when write fails

2025-02-22 Thread ritvikfoss
From: Ritvik Gupta 1. Close the file descriptor when write fails. 2. Introduce 'close_or_die' helper function to reduce repetition. Signed-off-by: Ritvik Gupta --- Changes in v2: - Fixed formatting .../selftests/mount/unprivileged-remount-test.c| 14 ++ 1 file changed, 10